cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jbrit2020
Super User
Super User

Similar to a timesheet submission app

I need to create a sort of "timesheets" app, but monthly not daily or weekly. 

 

So I have the following:

 

jbrit2020_0-1621353078012.png

 

My issue here is the structure in which I want to store the data.

 

I dont want a column per month, I want to store all the dates in a single column:

 

jbrit2020_1-1621353229713.png

I'm currently storing it in a very painful PATCH DEFAULT process where there's a patch default that looks at each textinput control and pastes that information on a new row.

 

I'm sure there's a better way of doing this, but can't think of any. It would also be good to find a way of with the same button switching between Patch Default and Patch (to only update a value in case it already exists)

 

 

3 REPLIES 3
CNT
Super User
Super User

@jbrit2020 Use the Concatenate( ) to build a comma separated string of values. For example if there are 3 months, you can use Concatenate(TextImput1.Text, ",",TextImput2.Text, ",",TextImput3.Text). This will give an output something like "10,,30" (in this case the second value is empty). You can store this in a single text column in your data source. When you read it back you can use the Split() function to split it into separate records. In our exampleif we split the returned value, you will get a table with three rows, "10","","30". You can display these values in your TextInputs in Power Apps. Hope that helps. 

Hi @CNT that will unfortunately end up being the same as having 12 columns on my database one for each month. I need each month to result in an individual row in SQL for analytics reasons. I don't want to have to go pivoting my tables for Tableau or PowerBI as it will cause performance issues when querying the data live.

 

Good shout though

@jbrit2020 That's even easier, Have a collection with 12 records corresponding to your 12 months. Add a Horizontal Gallery with this collection as your data source and add a Text Input in the Gallery (you will end up having 12 Textboxes b'coz u'r collection has 12 records). To patch the records just loop through the gallery ForAll(gallery.AllItems,.......) and add your logic inside the ForAll to Patch that records in your DB. Hope that helps. 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,665)