cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PeterKuehlian
Level: Powered On

dropdown default values resetting

Hi all

 

I have the following problem: I have created an app based on a SharePoint list. I want to add a time to a column in this SharePoint list and that works fine when patching a gallary containing some info to SharePoint. My problem is, as soon as I patch the information my default values are shown in the time fields. 

 

I do not want to show the default value in this fields but the selected value. 

I have tried to set Reset to false. The error still occours. (I am not even sure if it is an error...)

 

What is interesting: the values get patched corretly, but it seems that the dropdown fields are setting themselfe to default after patching?

 

These are the values for my dropdown field:

["06:00";"06:15";"06:30";"06:45";"07:00";"07:15";"07:30";"07:45";"08:00";"08:15";"08:30";"08:45";"09:00";"09:15";"09:30";"09:45";"10:00";"10:15";"10:30";"10:45";"11:00";"11:15";"11:30";"11:45";"12:00";"12:15";"12:30";"12:45";"13:00";"13:15";"13:30";"13:45";"14:00";"14:15";"14:30";"14:45";"15:00";"15:15";"15:30";"15:45";"16:00";"16:15";"16:30";"16:45"]

 

This is the code for my button to patch the line to the galary:

Patch(
    ArbeitszeitCollection;
    ThisItem;
    {
        TätigkeitItem: inputTätigkeit.Text;
        StundenAnzahl: Value(inputStunden.Text);
        ZeitVonStunden: inputUhrzeitVonStunden.Selected.Value;
        ZeitBisStunden: inputUhrzeitBisStunden.Selected.Value;
        Datum: Text(inputDatum.SelectedDate);
        ShowSaveButtons: false
    }
);;
If(
    EditPressed;
    false;
    Collect(
        ArbeitszeitCollection;
        {
            TätigkeitItem: "";
            StundenAnzahl: "0";
            ShowSaveButtons: true
        }
    )
);;
UpdateContext({EditPressed: false});;
Set(
    NeedsSaved;
    false
)

Does anyone have an idea how to fix this?

 

Best Regards

Peter

 

4 REPLIES 4
Super User
Super User

Re: dropdown default values resetting

Are you using a Reset() or ResetForm() anywhere in your app? You can try removing the code after the Patch() and see if it still resets the default value when the Patch is executed. This will tell you if the additional code is contributing to the issue.



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
PeterKuehlian
Level: Powered On

Re: dropdown default values resetting

Hi Jeff

 

Thank you for your reply. 

I am not using the Reset() funktion anywhere in my app. 

 

I have set Reset in properties to false (which was default btw)

I have removed the code after the patch function, error still occours. 

 

However, no improvements. 

 

Do you have any other ideas?

Dual Super User
Dual Super User

Re: dropdown default values resetting

Hi @PeterKuehlian 

 

Can you try to refresh the data source after the Patch() function? This will refresh the data source and reflect the latest values.
 
Expression: Patch(...);Refresh(DataSourceName)
 
Also, please share the formula used on the "Default" property of this dropdown control.
 
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
PeterKuehlian
Level: Powered On

Re: dropdown default values resetting

Hi

 

I can not refresh the connection. It is not patching directly to sharepoint but to a collection in the app. The app says, that I can not refresh a collection since it is no connection but inside of the app.

 

Default Property:

 

""

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,928)