The topic was closed without being answered but it is probably still unsolved because web searches didn’t give any valuable answer. Cf. Referencing relationship in collection via Custom API call action , where the issue is very well described.
@maksim this might interest you. Did you solve it?
Hi @galou,
Welcome to the community! ![]()
Based on the referenced topic content, you would either need a countdown as a list in a next screen (click the button > link to a new screen) where it finds the custom action value in the collection and then update the relation (same exact value should exists in both places) or using a MAKE scenario like @Victor did here. : https://youtu.be/AK3qUzRiy3o
Thank you and have a great day!
Hi @Dilon , thanks for the quick answer. I didn’t really understand the first solution. What do you mean with countdown? If I switch to another screen, can I come back to the original screen without user intervention?
As for the second method, it’s not really acceptable because it relies on yet-another third party service.
@galou I think there’s a bit of overcomplication happening here.
If you’re using a Custom API action and want to update a relationship field, the key thing you need is just the record ID of the item you want to relate. Adalo relationships are basically handled via IDs behind the scenes, so as long as your API call is sending that correctly, it should work.
For easier access between the two collections, you can also set up bi-directional (double) relationships:
-
Link Response → Trait
-
Then also link Trait → Response
This way, from either side, you can directly access the related data without needing workarounds.
No need for extra screens or external tools like Make in most cases
@galou I would make one step back and ask the question: why do you want to set up the relationship with the custom action? What is the usecase / issue you’re experiencing?
Any operations like these will require an access to Adalo Collections API. You can set up the relationship via the API. But the issue is that it is rarely needed from the Adalo app itself: it is much easier to do everything on Adalo side (e.g. run custom action → create Response record, fill it in with the results of custom action and also link it to current Trait).
Also, Adalo Collections API is now available only on Team+ plans, so using it is quite a rare case nowadays (unfortunately).
Best,
Victor.
I actually realize now that I’m using a different tool but having the same issue. I’m using a custom component not a custom action, as in the referenced topic.
Here is my use case:
- I have two collections, let’s say, “Catalog” and “Orders”.
- “Orders” contains a foreign key to “Catalog” also called “Catalog”.
- I want to create a new “Orders” record and set its “Catalog” field appropriately.
My first thought was that I use an "action” with catalogId as output argument (tried as number and string). Unfortunately, Adalo’s “Create” action doesn’t let me choose anything for the “Catalog” field (“Nothing Available”).
Also tried a formValue props both as text and number but it doesn’t work.
Hi @galou,
I meant the countdown trick found by Victor. : https://youtu.be/0OLszLhb_7k?si=3IVZHxrmKbhTfhSk
Something like, create the response with the custom action data along with the trait text > link to a new screen where this countdown list avaiable > filter the list with the saved trait text to find the correct trait from the collection > update the response record with the found trait.
Or else you need the collections api to find out the trait record. (or you could move forward with the join tables as an alternative to the relationship property. : Adalo Join Collections | Adalo Resources)
This would be because there’s no current catalog data.
Thank you and have a great day!