cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Unbihexium
Helper III
Helper III

ListBox usage

Hello all

Is it possible to use a Listbox as follow: --> please see screenshot1

Screenshot1.jpg

I want to fill the 4 fields (green frame) and by cliking the button (red frame) the informations are visible in the ListBox.
With every cklick on the button, it should create a new row in the ListBox with these 4 fields.
By clicking on a row in the ListBox, it should shows the given inputs in the fields (green frame)
to make correcions and by clicking again on the button it updates the specific row.

Screenshot2.jpg


Is this even possible? if yes how to? If not, is there maybe another way to achiev this?

Thanks in advance
regards

9 REPLIES 9
Drrickryp
Super User II
Super User II

Hi @Unbihexium 

I rarely use a listbox because you can use a gallery to accomplish the same thing and it is much more flexible in terms of design. 

Hi Drrickryp

 

Thank you for the hint. I will try it with a Gallery

Regards

Hi Drrickryp

I made it so far to get the informations to the Gallery.
Now I would like to select the made entries, after I have select it, the given information appears in the text input fields to make corrections. Not sure how to achieve this... or is this not possible at all?

How do I get the informations out of the collection?

Thanks in advance for any hint

01-09-2020 10-00-36.jpg

regards

Hi @Unbihexium 

You can set your TextInput box Default or hint to Gallery1.Selected.fieldname.  For the dropdown, set the default property to the same, Gallery1.Selected.fieldname.  Here is an example with the properties labeled: Gallery.png

Hi Drrickryp

Thanks for the hint. That was very helpful and works pretty good.

Had to change the button properties to get the values separately...

Unbihexium_0-1599054027043.png

... added one labe for each value to the Gallery...

Unbihexium_1-1599054135383.png


...and I've set the default properties (TextInput field) as recommended = it works

Unbihexium_2-1599054186699.png



one last question:
now I get the informations back in the fields (by clicking on the row) to make changes...
what would be the best way to update the selected row? (For now it just creates a new row instead of update it.)
with "if" function on the button? like "if selected; updatecontext " or won't this work? any recommendations?

 

Thanks in advance
regards

Use two buttons, one inside the gallery to update the row with a Patch(dataset, ThisItem,{etc,... and the other outside the gallery to add a new item as you are doing.

thanks again! I will give it a try.

at the moment I get an error:    "The specified column "Artnr." does not exist"

Unbihexium_0-1599058939786.png


Patch(Bestellliste.Liste; ThisItem.Liste;
{Artnr: DataCardValue13.Text};
{Bez: DataCardValue14.Text};
{Mng: DataCardValue15.Text};
{Date: DataCardValue16.SelectedDate})

Unbihexium_1-1599059044792.png

 

not sure why the column cannot be found ..I have declared it in the button above

 

I will try it further tomorrow

 

 

Annotation 2020-09-02 085352.pngHi @Unbihexium 

You need to reference the textboxes and dropdowns above your gallery in the {} part.  That is where you will capture the data that you are changing in the underlying dataset.  Stay with it. I think you are getting close.

Hi Drrickryp

Yup, exactly what I've tried, unfortunately I get almost always the same error. Something is missing and I cant figure out what.
If I use my variable "Bestellliste" or "Bestellliste.Liste" as the Source in the patch function, I get the error "The specified column "Artnr" Is not available (or does not exist)" --> I've tried it with diffrent syntax variations...get always the same error.

Unbihexium_0-1599142272906.png

Unbihexium_1-1599142344164.png

 

But if I use; "ThisItem.Liste" as the source in the patch function, I get no error but the items does not update my changes.

Unbihexium_2-1599142483078.png

Unbihexium_3-1599142773775.png

think I getting closer.. but stuck the whole day with this issue here
I keep working on it...
Do you have any idee what Im doing wrong?

regards

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,535)