Retrieving Data from Callback to show on frontend

:each item URL isn’t an option

you’ve changed the images datatype from the detect request to text?

my fault, youre right i set it back and am now getting the newimages to update:

but still not showing up on frontend unfortunately :\

could it because of what I have the repeatingroup and images set to?

I think this is what it should be tho?

Here is repeatinggroup on frontend:

and here is the image:

Okay, cool! :pray:

Now actually I’d say the best way to achieve what you want is

  • when triggering the initial api, create a new record with the prompt id
  • when you receive the call from the backend workflow, make changes to (do search for, newimages where prompt_id= prompt_id
  • on the front-end show this element and have a loading element and a condition on it where current group prompt_id is not empty and new images first is empty
  • once the backend workflow receives the images, it will update the record you have and will show the images and loader will disappear

so is there two prompt_id data types and the first one from initial API call has to match with the one from response of webhook?

Where would the first one be saved if the second one is under the datatype as newimages. I save it under the current user and its constantly dynamic ? since users can keep creating new image and it will constantly be changing ?

you should remove as well the list of images from current user datatype (it’s just extra data on essential datatype [user]) and anyways you save that in the db and you have the connection between the user, prompt, and response images

yes, the ids should match
you can have enabled and disabled option in the table, where the user create a new prompt
you can choose if you want to delete the old prompt and response, or keep it, but you can easily manage which is the most recent prompt and which prompts you want to keep the db and which you don’t want to

it’s one prompt with multiple images
prompt created on front-end
images updated with the callback — once updated it will automatically gets updated in the frontend

well these images saved to user are forever, i just want the images from this response to be temporary and dynamic, saved to user after created, but dynamic becuz user just make new ones after to replace these ‘newImages’

ideally you should never set the list of images on the users datatype
this should be managed with other tables/datatypes

you can in the table have a status if temp or permenant
and schedule a backend workflow that deletes the temp everyday

im really confused now.

This is what I have so far:

This is for the frontend when they click button:


api call…

setting prompt id from api
image
watching for change in promptid in user to trigger custom event…

Custom event:
set state of images in repeating group


hide loading button

backend:


create new imagedata…

save these iamges to user

set user promptID from response body.

how do I connect the two different promptID’s to detect the images in the workflow? this part is confusing me

Do a search for imagesnew where prompt_id = request header prompt id firstitem

and do not create a new record in the backend workflow … edit this record with the list of images

is this search done in the custom event?

All of what I’m referring doesn’t include a custom event

please re-check this reply

What do I put into workflow for receiving the call?

Doesn’t it have to be ‘trigger custom event when data changes’ and in that case i’d have to make a custom event?

how do i just wait a certain point in workflow to receive reponse from backend? becuz its not instant. it takes like 30-60 seconds to images to generate before it sends callback

no, when data changes in the front-end the do search for newimages will already load the newely created prompt and will update the image once it’s updated

I mentioned the loader element to cover the wait between the prompt id is created till the images are added through the backend workflow

the prompt id is changing right away from the frontend right after API Call (this part is insant).

getting response image is not instant.

i have loader element, i just really dont know what you mean when you say do a search for , and how to connect the callback prompt id to the frontend prompt id.

here is my current frontend workflow:






can you just please change the backend workflow instead of creating new record, make changes to a record … the record that you should change is: do a search for new images:firstitem where prompt=id = request prompt id
set list images = request images each item url


I can’t even ‘change’ anything about this thing becuase its red.

i could however do this whwen i created it as a new record.

promptID and newImages are data points under type ‘imageData’