ServiceStudio11/WebApp

When I create an Entity (Data) by a Form (Widget) I want another Entity to be created in the same step (Logic/Screen Action). In this example 'User' should create 'Profile'.

https://success.outsystems.com/Documentation/11/Developing_an_Application/Use_Data/Data_Modeling/Entity_Relationships/Create_a_One-to-One_Relationship

However, in my application, the 'User' Record is created and shows up in the data when the 'Profile' Entity does not. Did I forget something? I don't see what's wrong, or did I miss something in the Docs/Learning then please Link. Thank you.

hi,

you need to populate the profile itself. Then select the profile also.

Use left join condition user.id = profile.userid to show the profiles as well.

regards

Solution

Hi Benoit,

You always need to explicitly Create both records, there's no functionality in the Platform that one of the records is created automatically, if that's what you were assuming.

Solution

Thanks a lot. In my Logic/Screen Action I now use 'CreateOrUpdateUser' then 'CreateOrUpdateProfile'. In 'CreateOrUpdateProfile' I can expand 'Source' (there is a very tiny button to the left) to pick an 'Id' instead, which is provided by 'CreateOrUpdateUser' automatically.

Hi Benoit,

If you know for certain you're creating a new record, use CreateUser/CreateProfile instead of CreateOrUpdate, this will be slightly faster, and it will signal to someone reading that code that they can't be dealing with existing users/profiles.

Also, if my post above helped you solve this, please mark it as the Solution, thanks.