Post

3 followers Follow
0
Avatar

Create Calculation Field with Api - What is the variable format for @All of Map?

I'm trying to use the API to create a Calculation field that references a relationship field. If I were to create the calculation within Podio itself I would do...

var a = @All of Properties;

Now in the API it looks like the format would be...

var a = @All of Properties;

what do the 2 different numbers here represent? If I search through the source it appears that the first number is equal to the ID of the first field of the related app. While the second number seems to match up with a value here...

<option value="105045937" data-reactid=".0.0.1.0.0.2.1.0.1:$app.$2">.</option>

...which is a number I don't know where or how to get.

Any help would be appreciated.

Scott Costello Answered

Please sign in to leave a comment.

2 comments

1
Avatar

Hi Scott,

The format is in_VALUEID_REFERENCEID, where VALUEID is a field id in the related app with the values you want and REFERENCEID is the field id of the relationship field in the other app (since it's incoming references). To explain, consider the following scenario:

  • An app Products
  • An app Components with a relationship field pointing to Products (field id 1) and a number field Price (field id 2).

Assume we were to add a calculation field on Products to iterate over all component prices. We would then do:

var prices = @[All of Prices](in_2_1);
// more code here

I hope the above makes sense.

Best,
Andreas

Andreas Garnæs 1 vote
Comment actions Permalink