Record created by a Flow doesnt carry its reference component

RodrigoA
Tera Contributor

Hello everyone, Im currently on the Intern program of a company and, as a challenge, I need to develop an application revolting around movie ratings.

To keep things short, I have a table called Movies, in wich a user can fill the Title field and, through a Integration, the form the rest of the fields by Itself, including the Directors and Actors fields, both fields are string type that carry references to other tables with the same name.

Capturar.PNG

 

In order to automize the filling of those other 2 tables (Directors and Actors tables), I`ve created a flow that triggers whenever a new record is submitted in the Movie table. I`ve created a many 2 many table in order to store the pairs (Director-Movie and Actor-Movie), and my flow has successfully filled the m2m table. 

 

Capturar2.PNG

 

My problem is in the m2m table, since the Actor field carries the reference, while the Movie field does not. This is important since part of my challenge is to configure Related Lists to the Movie table, and I intended to use this m2m table to do that. Can anyone tell me what is going on?

 

Capturar3.PNG

I`ll follow up with screenshots from my flow so y`all can follow the logic, the Transform to Array action is a custom action that gets the Actor (or Director field) from the Movie table (that comes in string format due to the integration) and transforms it into an array of strings, in order to be compared to records in the Directors table (In order to avoid repeating records with the same name). Thanks in advance!

 

Capturar4.PNG

 

Capturar5.PNG

p.s. The Directors table is being populated corretly, thats why I did not screenshot that specific action.

3 REPLIES 3

lipan
Tera Contributor

As a correction, you should change the type of all reference fields to reference

RodrigoA
Tera Contributor

Yeah, I`ve tried that but it only makes my records be added as empty values in the m2m table

Sandeep Rajput
Tera Patron
Tera Patron

@RodrigoA Reference field should always carry reference than a string value of sys_id.