How to reference value of result of more complex math module?

I seem to be unable to reference the result value of a math module that is slightly more complex than a simple value.

When using the math module, if I have a relatively simple expression, the resulting value is easy to reference, as shown:
image
image

However, when the expression is slightly more complex, the resulting value is put into a collection that doesn’t expand and that I can’t figure out how to reference:
image
image

I’ve tried all sorts of things:

  • map() gives an error that it’s not a valid array
  • toArray() just creates an array of collections for some reason
    *get() and pick() also give weird errors.

Does anyone have any tips for how to force the collection to expand so that I can reference the values or how I can reference the values directly?

Thanks

EDIT: I should also add that I’ve tried manually typing {{[module-number].result.value}}, which creates a reference, but the end result is blank.

Ok, so I found a temporary workaround. It’s not great, but it’ll have to do until someone at make fixes it.

  1. Transform the Math module result to JSON
  2. Parse JSON from step one.
  3. Reference the relevant value from the parsed json in step 2.

Hello @IMIMIM welcome to the community :wave:

Thanks so much for bringing this up here and for sharing your findings with the community. We totally appreciate it :pray:

I just wanted to jump in with some extra information quickly. Currently, our Math module has the result hardcoded as a simple item. Due to that, even if it changes to a collection, it will still be displayed as a simple item in the mapping panel.

However, using the get () function should do the trick here. Here’s the configuration you’ll want to use:


image


Hope this helps

2 Likes

Hi. Unfortunately, the get function doesn’t work, either. As I mentioned in an a response to a support ticket, the end result is blank:
image

Thanks for looking.

Also, here is a formula that you can try in the math module to see for yourself:

((bignumber(“0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff”)-bignumber(“0xfffffffffffffffffffffffffffffffffffffffffffffffffffd7f732f490a93”))+1) * -1

Can the math module be updated please? Because the workaround that I found, while it works, isn’t good. I have to run this thing on thousands of entries, and that winds up adding a lot of cost.

Thanks