Pergunta

I need to set up a dropdown selection based on a button trigger. If button not selected, dropdown must remain empty.

Could anyone assist?

Using following syntax on the dropdown:

If(button1.selected, dropdown1= "selection", "")
Foi útil?

Solução

Add this formula on OnVisible property of Screen:

UpdateContext({ddDefaultValue: ""})

Then set Default property of dropdown control to:

ddDefaultValue

Add below formula on OnSelect property of button:

UpdateContext({ddDefaultValue: "selection"})

For more information, refer: Set Dropdown value with Button Click

Outras dicas

A few things you should notice:

  1. There is no Selected property for Button control.

    As far as I know, you can only configure one-way action on one button control, there is no “release” or “unselect” status for it once the button is clicked, unless you reset Button.OnSelect from outside.

    You will need a second button if you want to clear the dropdown control value.

  2. If you decide to use UpdateContext function (as the first Answer introduced), note that the default value should be set on the Choice column data card instead of the combo box (DataCardValue2)

    For example: <ChoiceColumn>_DataCard.Default = { Value: ddDefaultValue }

Licenciado em: CC-BY-SA com atribuição
Não afiliado a sharepoint.stackexchange
scroll top