1

I have a question regarding PowerApp Forms in SharePoint online.

Basically in yearlier versions of SharePoint, when there were just forms, I could enject javascript to retrieve value from a list based on the input in a particular TaxnomyField.

Now I'm experimenting with SharePoint online and I'm wondering how can I achieve the same? If I understood correctly it is not possible to add javascript, which are other my options?

Also important to know, is that this should only be available with when you add a new item. It can be automatically or with a press of a button.

Regards

1 Answer 1

0

PowerApps does not allow javascript, but it certainly has button click events (onselect) where you can take actions.

Though, if you just need to set a value when an item is added/modified, another option is Flow, which could look up a value in a different list and set the value in the current list for any new item.

edit: To set a value based on a lookup into another list, a button isn't needed. In textinput2, put: First(Filter(list2,Title=TextInput1.Text)).Title. If it needs to be on a button, this is a little tricker, in that powerapps doesn't have a "set value in textbox" capability. Instead, set a variable in the button event, and then use that variable in the textbox.

button.onselect=Set(varLookupValue,First(Filter(list2,Title=TextInput1.Text)).Title
textinput2.default=varLookupValue
4
  • No, I need to set a value to a field. So for example: Someone is filling the form, and adds a value to a textfield1, so when i click on a button for example it checks the value of that textfield1 and add a value from a list based on that textfield1 into textfield2 ... can I do that? can you assist on that?
    – Shkipper
    Commented Apr 30, 2019 at 7:14
  • I added a code sample to the original answer. hope that helps. Reading from the inside out, the list2 is filtered to get rows where the title equals the value in textinput1. Since this can return mutiple rows, the first function is used to get one row. From that one row, the title is retrieved, and is set into the variable varLookupValue. Textinput2 is set to have a default value of what ever is stored inside the variable. When the variable changes, then textinput2 will automatically be updated.
    – Mike2500
    Commented May 1, 2019 at 12:49
  • where exactly should i put in textinput2? onchange or onselect?
    – Shkipper
    Commented May 2, 2019 at 8:25
  • and one more problem, it is not really a lookup field, but a taxonomy field, so there is no connection to a list, so I get an error when i do filter, because he does not see the connection with another lists :(, how to work around it?
    – Shkipper
    Commented May 2, 2019 at 8:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.