Skip to main content
1-Visitor
January 6, 2021
Question

Write a formula using selected rows of a grid

  • January 6, 2021
  • 1 reply
  • 3722 views

Hello,

I Want to write a formula or an expression using selected rows of a grid, if you have any idea how to do it i would be grateful.

I will attach what I want to do in the mashup

 

Thanks in advance 

1 reply

Community Manager
January 8, 2021

Hi @AN_9685270.

 

We're not clear on your needs.  Please provide more detail around the use case.  What specifically are you trying to do?

 

Regards.

 

--Sharon

1-Visitor
January 12, 2021

thank you @slangley for your reply,

 

what i want is to write an expression or a forumula( like in excel ). 

So my idea is, i want to write the id of (selected  row from the grid) in a text field and do  some calculations.

 

For example: 

if i have in my grid :

Id :A ,thing1,( with some properties: like  propValue

Id: B ,thing2,

Id: C, thing3

and I want to make a forumula between those things 

formula  = A +C/B

(so the meaning behing is

formula = Things["thing1"].propValue +Things["thing3"].propValue /Things["thing2"].propValue 

then this formula is applied on a propValue of our new (thing which is equivalent to an energy meter)

I Wish i was clear and thank you in advance

15-Moonstone
January 15, 2021

Hi @AN_9685270 ,

 

If you have predefined list of formulas and just want to take input from a grid; Then you can follow below procedure.

  • Create a custom service to use/write formulae based on your input.
  • Mashup : 
    • Allow selection in grid
    • The required input for the custom service can be bound from the selected rows of the service from which grid data is populated.
    • To trigger the custom service , you can make use of SelectedRowChanged event of the service that populates the grid data.

Hope it Helps!!!