I am looking to save the dropdown selection from a gallery, which has a repeating functionality. Users select either "Positive" (the default selection) or "Negative."When I hit "save," it should update my list with the user inputs. However, when I selected "Negative" and then hit save, it immediately defaults back to "Positive." Any ideas? Thanks!
Solved! Go to Solution.
@Anonymous
Very good. Sounds like forward progress.
Now, just change your OnSuccess action of your form to the following:
Collect(
ISPFLLNegative,
ForAll(
Filter(InputCollection, !IsBlank(MultiLineProblem)),
{Title: MultiLineProblem,
'Recommended Solution': MultiLineSolution,
MasterID: Self.LastSubmit.ID,
PN: ChoicePN
}
)
)
In your previous formula (beside the ForAll being backward) you were using the value of the Dropdown1 from the screen...not your collection. So you would have only gotten the selection from the first row in your gallery into all records created.
The above formula will give you what you need.
@Anonymous
Is there any particular reason that you have an EditForm and are using Patch to submit it rather than SubmitForm?
You should only be doing a SubmitForm on the form, otherwise you will have unpredictable results as you are seeing.
It is not a form but a gallery functioning as a repeating table of sorts, allowing for multiple imputs that are all connected to a form. (The title, product, etc. you see at the top of the screenshot).
@Anonymous
Thanks for the clarification. It all looked like a form 😉
So, the above is a form though - is this information to be submitted in the record of the form or are the contents of this Gallery going some place else?
As for the dropdown that you were dealing with - what is the Default property of that control in your gallery?
The contents of the form and gallery go to two separate lists (but are tied together with a MasterID number). The idea is that the user can input multiple comments (via the gallery) for one project (the form).
As for the dropdown, the default property is "1"
@Anonymous
Well, as for the Default property...there is your issue. You don't have it set to anything. It needs to be the underlying record value for it to "retain".
Set the Default to : ThisItem.ChoicePN.Value
In your OnSuccess of the editform, the following formula:
Collect(yourOtherDataSourceName,
AddColumns(Filter(InputCollection, !IsBlank(MultiLineProblem)),
"yourMasterIDColumnName", Self.LastSubmit.ID
)
)
The above formula implies a couple of things:
1) That all of the items in your gallery (problem, solution, choice) must be completed and you have already accounted for this when adding to the collection - so, the above filter will get rid of any rows that don't have a problem filled in (i.e. your blank row).
2) That the names of your columns (MultiLineProblem, etc) in your collection match EXACTLY the real names of the columns in your list.
3) That the ChoicePN column in your list is a text column and not a Choices column
If any of the above implications are not correct, please let me know which and what is different.
Changing the default property did not make a difference.
As far as assumptions, assumptions 1&2 are correct but 3 is not. My ChoicesPN column is a Choices column
@Anonymous
Yes, this was why #3 was important. You are saving the text value of the record to your underlying collection.
So, If it is a choice, then you need to change the formula you have for the save icon to the following:
Patch(InputCollection, ThisItem,
{MultiLineProblem: inputProblem.Text,
MultiLineSolution: inputSolution.Text,
ChoicePN: Dropdown1.Selected
}
);
Collect(InputCollection,
{MultiLineProblem: "",
MultiLineSolution: "",
ChoicePN: {Value:""}
}
)
Default on the dropdown should remain as : ThisItem.ChoicePN.Value
Unfortunately it is still switching to positive
@Anonymous
Then your underlying collection is not getting updated properly. Can you look at the collection viewer and see what it is capturing?
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
181 | |
52 | |
41 | |
39 | |
33 |
User | Count |
---|---|
262 | |
81 | |
71 | |
69 | |
66 |