May 13, 2020 03:05 PM
Hello!
I’ve got a few questions that I’m having a hard time figuring out the best approach to solve or if it can be solved easily (very much not a JS person)… I want to create a record in a table based on conditions from the original table. The new record should copy information from the original table that are held as different field types.
Something like this:
Conditions for new record:
If xTeam
is in thisField
, then create new record in otherTable
Data to be copied:
thisTable.launchDate
= otherTable.liveDate
thisTable.activityDescription
= otherTable.description
thisTable.launch
= otherTable.launch
--> (this is currently a lookup between the two tables where otherTable
looks up thisTable
)
thisTable.activityOwner
= otherTable.requestor
--> (this is currently a lookup from a 3rd table)
write otherTable.status
as request
Is this feasible in the scripting block? and are there any good examples/resources on the types of functions to write to execute this?
I’m also concerned about duplicate records, I would want to run this script weekly - is it possible to only run a script on a particular view (e.g. filtering for records created within a certain time period)
Solved! Go to Solution.
May 14, 2020 12:58 PM
This is quite possible with scripting block.
When you get the records from thisTable, you can get records from only a specific view. Use SelectRecordsAsync
on the view instead of the table.
Are the lookup values the ones that will change field type? What is the new field type? You might have to play around a bit to get the lookup values in the format you want. The documentation used to state that the read format of lookup fields was unstable. It now says that the read format of lookups is an array.
May 14, 2020 12:58 PM
This is quite possible with scripting block.
When you get the records from thisTable, you can get records from only a specific view. Use SelectRecordsAsync
on the view instead of the table.
Are the lookup values the ones that will change field type? What is the new field type? You might have to play around a bit to get the lookup values in the format you want. The documentation used to state that the read format of lookup fields was unstable. It now says that the read format of lookups is an array.