cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dyee4614
Helper V
Helper V

Trouble Submitting Data to CDS

I made a few changes so I'm modifying my initial post with more information.  Due to the October updates, I'm looking into using CDS as my data source.  I just built a CDS entity, copied my app to a new environment, and pointed the new app to the CDS entity.  

 

My app has two collections.  The first is data1 which is a gallery of questions that updates when someone fills in a question the second collection is submitdata which holds my data until I patch it over.  

 

 

Collection #1: Data 1 Code

ClearCollect(Data1,
  {Q_ID: 1, Q_Type:"Exterior",Q_Desc:"Parking lot", Ans: ""},
  {Q_ID: 2, Q_Type:"Exterior",Q_Desc:"Walkways/Halls", Ans: ""},
  {Q_ID: 3, Q_Type:"Exterior",Q_Desc:"Sidewalks",  Ans: ""},
  {Q_ID: 4, Q_Type:"Exterior",Q_Desc:"Patio", Ans:""},
  {Q_ID: 5, Q_Type:"Living Room",Q_Desc:"Entrance Door/Door Lock", Ans:""},
  {Q_ID: 6, Q_Type:"Living Room",Q_Desc:"Eletric Outlets", Ans:""},
  {Q_ID: 7, Q_Type:"Living Room",Q_Desc:"Sprinkler Head", Ans:""},
  {Q_ID: 8, Q_Type:"Living Room",Q_Desc:"Smoke Dector", Ans:""},
  {Q_ID: 9, Q_Type:"Living Room",Q_Desc:"Walls and Ceiling", Ans:""},
  {Q_ID: 10, Q_Type:"Living Room",Q_Desc:"Floor/Tiles", Ans:""},
  {Q_ID: 11, Q_Type:"Living Room", Q_Desc:"Windows/Curtains/Blinds", Ans:""},
  {Q_ID: 12, Q_Type:"Living Room",Q_Desc:"Doors", Opt1:"Clean/OK", Ans:""},
  {Q_ID: 13, Q_Type:"Living Room",Q_Desc:"Light Fixtures", Ans:""},
  {Q_ID: 14, Q_Type:"Living Room",Q_Desc:"Lamp(s)", Ans:""},
  {Q_ID: 15, Q_Type:"Living Room",Q_Desc:"Baseboards/Moldings", Ans:""},
  {Q_ID: 16, Q_Type:"Living Room",Q_Desc:"Fire Extinguisher", Ans:""},
  {Q_ID: 17, Q_Type:"Living Room",Q_Desc:"First Aid Kit", Ans:""},
  {Q_ID: 18, Q_Type:"Kitchen",Q_Desc:"Stove/Oven", Ans:""},
  {Q_ID: 19, Q_Type:"Kitchen",Q_Desc:"Range/Hood", Ans:""},
  {Q_ID: 20, Q_Type:"Kitchen",Q_Desc:"Sink/Faucet", Ans:""},
  {Q_ID: 21, Q_Type:"Kitchen",Q_Desc:"Refrigerator/Refrigerator Bulb", Ans:""},
  {Q_ID: 22, Q_Type:"Kitchen",Q_Desc:"Light Fixture", Ans:""},
  {Q_ID: 23, Q_Type:"Kitchen",Q_Desc:"Cabinets/Drawers", Ans:""},
  {Q_ID: 24, Q_Type:"Kitchen",Q_Desc:"Counter Surfaces", Ans:""},
  {Q_ID: 25, Q_Type:"Kitchen",Q_Desc:"Garbage Disposal", Ans:""},
  {Q_ID: 26, Q_Type:"Kitchen",Q_Desc:"Microwave Oven", Ans:""},
  {Q_ID: 27, Q_Type:"Kitchen",Q_Desc:"Furniture", Ans:""},
  {Q_ID: 28, Q_Type:"Kitchen",Q_Desc:"Dishwasher", Ans:""},
  {Q_ID: 29, Q_Type:"Kitchen",Q_Desc:"Floor/Tiles", Ans:""},
  {Q_ID: 30, Q_Type:"Kitchen",Q_Desc:"Wall and Ceiling", Ans:""},
  {Q_ID: 31, Q_Type:"Kitchen",Q_Desc:"Eletric Outlets/Switches", Ans:""},
  {Q_ID: 32, Q_Type:"Bathroom",Q_Desc:"Walls and Ceiling", Ans:""},
  {Q_ID: 33, Q_Type:"Bathroom",Q_Desc:"Floor Covering", Ans:""},
  {Q_ID: 34, Q_Type:"Bathroom",Q_Desc:"Windows/Curtains/Blinds", Ans:""},
  {Q_ID: 35, Q_Type:"Bathroom",Q_Desc:"Doors/Door Lock", Ans:""},
  {Q_ID: 36, Q_Type:"Bathroom",Q_Desc:"Light Fixtures", Ans:""},
  {Q_ID: 37, Q_Type:"Bathroom",Q_Desc:"Cabinets/Drawers", Ans:""},
  {Q_ID: 38, Q_Type:"Bathroom",Q_Desc:"Counter Surfaces", Ans:""},
  {Q_ID: 39, Q_Type:"Bathroom",Q_Desc:"Sink and Faucet", Ans:""},
  {Q_ID: 40, Q_Type:"Bathroom",Q_Desc:"Toilet/Tissue Holder", Ans:""},
  {Q_ID: 41, Q_Type:"Bathroom",Q_Desc:"Shower and Tub", Ans:""},
  {Q_ID: 42, Q_Type:"Bathroom",Q_Desc:"Towel Racks", Ans:""},
  {Q_ID: 43, Q_Type:"Bathroom",Q_Desc:"Mirror/Medicine Cabinet", Ans:""},
  {Q_ID: 44, Q_Type:"Bathroom",Q_Desc:"Water (Hot and Pressure)", Ans:""},
  {Q_ID: 45, Q_Type:"Bathroom",Q_Desc:"Electric Outlets/Switches", Ans:""},
  {Q_ID: 46, Q_Type:"Bathroom",Q_Desc:"Vent/Exhaust Fan", Ans:""},
  {Q_ID: 47, Q_Type:"Bedrooms",Q_Desc:"Walls and Ceiling", Ans:""},
  {Q_ID: 48, Q_Type:"Bedrooms",Q_Desc:"Floor Covering", Ans:""},
  {Q_ID: 49, Q_Type:"Bedrooms",Q_Desc:"Windows/Curtains/Blinds", Ans:""},
  {Q_ID: 50, Q_Type:"Bedrooms",Q_Desc:"Door/Door Lock", Ans:""},
  {Q_ID: 51, Q_Type:"Bedrooms",Q_Desc:"Light Fixtures", Ans:""},
  {Q_ID: 52, Q_Type:"Bedrooms",Q_Desc:"Closets/Shelves",  Ans:""},
  {Q_ID: 53, Q_Type:"Bedrooms",Q_Desc:"Shelves", Ans:""},
  {Q_ID: 54, Q_Type:"Bedrooms",Q_Desc:"Molding and Baseboards", Ans:""},
  {Q_ID: 55, Q_Type:"Bedrooms",Q_Desc:"Furniture", Ans:""},
  {Q_ID: 56, Q_Type:"Bedrooms",Q_Desc:"Mirror", Ans:""},
  {Q_ID: 57, Q_Type:"Bedrooms",Q_Desc:"Heating/Cooling Units", Ans:""},
  {Q_ID: 58, Q_Type:"Bedrooms",Q_Desc:"Bunks/Storage Units", Ans:""},
  {Q_ID: 59, Q_Type:"Kitchen2",Q_Desc:"Stove/Oven", Ans:""},
  {Q_ID: 60, Q_Type:"Kitchen2",Q_Desc:"Range/Hood", Ans:""},
  {Q_ID: 61, Q_Type:"Kitchen2",Q_Desc:"Sink/Faucet", Ans:""},
  {Q_ID: 62, Q_Type:"Kitchen2",Q_Desc:"Refrigerator/Refrigerator Bulb", Ans:""},
  {Q_ID: 63, Q_Type:"Kitchen2",Q_Desc:"Light Fixture", Ans:""},
  {Q_ID: 64, Q_Type:"Kitchen2",Q_Desc:"Cabinets/Drawers", Ans:""},
  {Q_ID: 65, Q_Type:"Kitchen2",Q_Desc:"Counter Surfaces", Ans:""},
  {Q_ID: 66, Q_Type:"Kitchen2",Q_Desc:"Garbage Disposal", Ans:""},
  {Q_ID: 67, Q_Type:"Kitchen2",Q_Desc:"Microwave Oven", Ans:""},
  {Q_ID: 68, Q_Type:"Kitchen2",Q_Desc:"Furniture", Ans:""},
  {Q_ID: 69, Q_Type:"Kitchen2",Q_Desc:"Dishwasher", Ans:""},
  {Q_ID: 70, Q_Type:"Kitchen2",Q_Desc:"Floor/Tiles", Ans:""},
  {Q_ID: 71, Q_Type:"Kitchen2",Q_Desc:"Wall and Ceiling", Ans:""},
  {Q_ID: 72, Q_Type:"Kitchen2",Q_Desc:"Electric Outlets/Switches", Ans:""});
  UpdateContext({Blue1: true, Blue2:false, Blue3: false, Blue4: false, Blue5: false});
  UpdateContext({RoomD:"Bedrooms"});UpdateContext({Notes:false});UpdateContext({Comment10:false});UpdateContext({Dropdown: false})
  

Collection #2: SubmitData.  This is how we store the data on the device. 

 

Set(now1,Now());
Collect(SubmitData,
{
Q1: LookUp(Data1, Q_ID=1).Ans,
Q2: LookUp(Data1, Q_ID=2).Ans,
Q3: LookUp(Data1, Q_ID=3).Ans,
Q4: LookUp(Data1, Q_ID=4).Ans,
Q5: LookUp(Data1, Q_ID=5).Ans,
Q6: LookUp(Data1, Q_ID=6).Ans,
Q7: LookUp(Data1, Q_ID=7).Ans,
Q8: LookUp(Data1, Q_ID=8).Ans,
Q9: LookUp(Data1, Q_ID=9).Ans,
Q10: LookUp(Data1, Q_ID=10).Ans,
Q11: LookUp(Data1, Q_ID=11).Ans,
Q12: LookUp(Data1, Q_ID=12).Ans,
Q13: LookUp(Data1, Q_ID=13).Ans,
Q14: LookUp(Data1, Q_ID=14).Ans,
Q15: LookUp(Data1, Q_ID=15).Ans,
Q16: LookUp(Data1, Q_ID=16).Ans,
Q17: LookUp(Data1, Q_ID=17).Ans,
Q18: LookUp(Data1, Q_ID=18).Ans,
Q19: LookUp(Data1, Q_ID=19).Ans,
Q20: LookUp(Data1, Q_ID=20).Ans,
Q21: LookUp(Data1, Q_ID=21).Ans,
Q22: LookUp(Data1, Q_ID=22).Ans,
Q23: LookUp(Data1, Q_ID=23).Ans,
Q24: LookUp(Data1, Q_ID=24).Ans,
Q25: LookUp(Data1, Q_ID=25).Ans,
Q26: LookUp(Data1, Q_ID=26).Ans,
Q27: LookUp(Data1, Q_ID=27).Ans,
Q28: LookUp(Data1, Q_ID=28).Ans,
Q29: LookUp(Data1, Q_ID=29).Ans,
Q30: LookUp(Data1, Q_ID=30).Ans,
Q31: LookUp(Data1, Q_ID=31).Ans,
Q32: LookUp(Data1, Q_ID=32).Ans,
Q33: LookUp(Data1, Q_ID=33).Ans,
Q34: LookUp(Data1, Q_ID=34).Ans,
Q35: LookUp(Data1, Q_ID=35).Ans,
Q36: LookUp(Data1, Q_ID=36).Ans,
Q37: LookUp(Data1, Q_ID=37).Ans,
Q38: LookUp(Data1, Q_ID=38).Ans,
Q39: LookUp(Data1, Q_ID=39).Ans,
Q40: LookUp(Data1, Q_ID=40).Ans,
Q41: LookUp(Data1, Q_ID=41).Ans,
Q42: LookUp(Data1, Q_ID=42).Ans,
Q43: LookUp(Data1, Q_ID=43).Ans,
Q44: LookUp(Data1, Q_ID=44).Ans,
Q45: LookUp(Data1, Q_ID=45).Ans,
Q46: LookUp(Data1, Q_ID=46).Ans,
Q47: LookUp(Data1, Q_ID=47).Ans,
Q48: LookUp(Data1, Q_ID=48).Ans,
Q49: LookUp(Data1, Q_ID=49).Ans,
Q50: LookUp(Data1, Q_ID=50).Ans,
Q51: LookUp(Data1, Q_ID=51).Ans,
Q52: LookUp(Data1, Q_ID=52).Ans,
Q53: LookUp(Data1, Q_ID=53).Ans,
Q54: LookUp(Data1, Q_ID=54).Ans,
Q55: LookUp(Data1, Q_ID=55).Ans,
Q56: LookUp(Data1, Q_ID=56).Ans,
Q57: LookUp(Data1, Q_ID=57).Ans,
Q58: LookUp(Data1, Q_ID=58).Ans,
Q59: LookUp(Data1, Q_ID=59).Ans,
Q60: LookUp(Data1, Q_ID=60).Ans,
Q61: LookUp(Data1, Q_ID=61).Ans,
Q62: LookUp(Data1, Q_ID=62).Ans,
Q63: LookUp(Data1, Q_ID=63).Ans,
Q64: LookUp(Data1, Q_ID=64).Ans,
Q65: LookUp(Data1, Q_ID=65).Ans,
Q66: LookUp(Data1, Q_ID=66).Ans,
Q67: LookUp(Data1, Q_ID=67).Ans,
Q68: LookUp(Data1, Q_ID=68).Ans,
Q69: LookUp(Data1, Q_ID=69).Ans,
Q70: LookUp(Data1, Q_ID=70).Ans,
Q71: LookUp(Data1, Q_ID=71).Ans,
Q72: LookUp(Data1, Q_ID=72).Ans,
ID:If(IsEmpty(SubmitData),Last(h2a2).ID+1,Last(SubmitData).ID+1),
Counter: If(IsEmpty(SubmitData),1,Last(SubmitData).Counter+1),
ddate: date100.Text,
User: User().FullName,
Location: LookUp(Fix,Q_ID=1).Location,
RM: LookUp(Fix,Q_ID=2).Room,
MaxOccupants: MO.Text,
Comment: Comment.Text,
CommentType: commenttype.SelectedText.Value,
CloseDate:"",
Status: If(Checkbox1.Value=true,"Open","N/A")
}
);
SaveData(SubmitData,"datasave");Reset(Comment);Clear(Data1); Navigate(Home,ScreenTransition.None)

Finally, the patch to submit it to the dataset.  The DefaultsMyTable is a set that is Set(DefaultsMyTable, Defaults(h2a2))

ForAll(SubmitData,Patch(h2a2,DefaultsMyTable,
{
ID:ID,
Counter:Counter,
ddate: ddate,
User: User,
Location: Location,
RM: RM,
MaxOccupants: MaxOccupants,
Comment: Comment,
CommentType: CommentType,
CloseDate: CloseDate,
Status: Status,
Q1:Q1,
Q2:Q2,
Q3:Q3,
Q4:Q4,
Q5:Q5,
Q6:Q6,
Q7:Q7,
Q8:Q8,
Q9:Q9,
Q10:Q10,
Q11:Q11,
Q12:Q12,
Q13:Q13,
Q14:Q14,
Q15:Q15,
Q16:Q16,
Q17:Q17,
Q18:Q18,
Q19:Q19,
Q20:Q20,
Q21:Q21,
Q22:Q22,
Q23:Q23,
Q24:Q24,
Q25:Q25,
Q26:Q26,
Q27:Q27,
Q28:Q28,
Q29:Q29,
Q30:Q30,
Q31:Q31,
Q32:Q32,
Q33:Q33,
Q34:Q34,
Q35:Q35,
Q36:Q36,
Q37:Q37,
Q38:Q38,
Q39:Q39,
Q40:Q40,
Q41:Q41,
Q42:Q42,
Q43:Q43,
Q44:Q44,
Q45:Q45,
Q46:Q46,
Q47:Q47,
Q48:Q48,
Q49:Q49,
Q50:Q50,
Q51:Q51,
Q52:Q52,
Q53:Q53,
Q54:Q54,
Q55:Q55,
Q56:Q56,
Q57:Q57,
Q58:Q58,
Q59:Q59,
Q60:Q60,
Q61:Q61,
Q62:Q62,
Q63:Q63,
Q64:Q64,
Q65:Q65,
Q66:Q66,
Q67:Q67,
Q68:Q68,
Q69:Q69,
Q70:Q70,
Q71:Q71,
Q72:Q72
}));
Clear(SubmitData);Set(Counter,1);ClearCollect(Counter2,Counter);Reset(datepicker1)

When I press submit, no data transfer to the CDS.  

1 ACCEPTED SOLUTION

Accepted Solutions
v-monli-msft
Community Support
Community Support

Hi @dyee4614 ,

 

What are these parameters stand for in this app marked as red in below formula?

ID:ID,
Counter:Counter,
ddate: ddate,
...

 

Also, you should delete the last "," in this formula.

Q10:Q10,
}));

 

To patch value to SQL date field, please take a look at below blog:

https://powerapps.microsoft.com/en-us/blog/working-with-datetime-values-in-sql/

 

Regards,

Mona

 

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-monli-msft
Community Support
Community Support

Hi @dyee4614 ,

 

What are these parameters stand for in this app marked as red in below formula?

ID:ID,
Counter:Counter,
ddate: ddate,
...

 

Also, you should delete the last "," in this formula.

Q10:Q10,
}));

 

To patch value to SQL date field, please take a look at below blog:

https://powerapps.microsoft.com/en-us/blog/working-with-datetime-values-in-sql/

 

Regards,

Mona

 

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

@v-monli-msft 


FYI - I decided to try to build it in CDS instead of Azure.   I left out some information on how the app works so hopefully this will help clarify things.  I have switched the datasource from the excel file to my CDS file and I modified the fields to match the same type as CDS.  I have no errors in my updated app.  However, when I press submit nothing patches over.  

 

Collect #1 - Data 1.  These are all my gallery questions.  I have the gallery set to update the collection based on the selected answer.

ClearCollect(Data1,
  {Q_ID: 1, Q_Type:"Exterior",Q_Desc:"Parking lot", Ans: ""},
  {Q_ID: 2, Q_Type:"Exterior",Q_Desc:"Walkways/Halls", Ans: ""},
  {Q_ID: 3, Q_Type:"Exterior",Q_Desc:"Sidewalks",  Ans: ""},
  {Q_ID: 4, Q_Type:"Exterior",Q_Desc:"Patio", Ans:""},
  {Q_ID: 5, Q_Type:"Living Room",Q_Desc:"Entrance Door/Door Lock", Ans:""},
  {Q_ID: 6, Q_Type:"Living Room",Q_Desc:"Eletric Outlets", Ans:""},
  {Q_ID: 7, Q_Type:"Living Room",Q_Desc:"Sprinkler Head", Ans:""},
  {Q_ID: 8, Q_Type:"Living Room",Q_Desc:"Smoke Dector", Ans:""},
  {Q_ID: 9, Q_Type:"Living Room",Q_Desc:"Walls and Ceiling", Ans:""},
  {Q_ID: 10, Q_Type:"Living Room",Q_Desc:"Floor/Tiles", Ans:""},
  {Q_ID: 11, Q_Type:"Living Room", Q_Desc:"Windows/Curtains/Blinds", Ans:""},
  {Q_ID: 12, Q_Type:"Living Room",Q_Desc:"Doors", Opt1:"Clean/OK", Ans:""},
  {Q_ID: 13, Q_Type:"Living Room",Q_Desc:"Light Fixtures", Ans:""},
  {Q_ID: 14, Q_Type:"Living Room",Q_Desc:"Lamp(s)", Ans:""},
  {Q_ID: 15, Q_Type:"Living Room",Q_Desc:"Baseboards/Moldings", Ans:""},
  {Q_ID: 16, Q_Type:"Living Room",Q_Desc:"Fire Extinguisher", Ans:""},
  {Q_ID: 17, Q_Type:"Living Room",Q_Desc:"First Aid Kit", Ans:""},
  {Q_ID: 18, Q_Type:"Kitchen",Q_Desc:"Stove/Oven", Ans:""},
  {Q_ID: 19, Q_Type:"Kitchen",Q_Desc:"Range/Hood", Ans:""},
  {Q_ID: 20, Q_Type:"Kitchen",Q_Desc:"Sink/Faucet", Ans:""},
  {Q_ID: 21, Q_Type:"Kitchen",Q_Desc:"Refrigerator/Refrigerator Bulb", Ans:""},
  {Q_ID: 22, Q_Type:"Kitchen",Q_Desc:"Light Fixture", Ans:""},
  {Q_ID: 23, Q_Type:"Kitchen",Q_Desc:"Cabinets/Drawers", Ans:""},
  {Q_ID: 24, Q_Type:"Kitchen",Q_Desc:"Counter Surfaces", Ans:""},
  {Q_ID: 25, Q_Type:"Kitchen",Q_Desc:"Garbage Disposal", Ans:""},
  {Q_ID: 26, Q_Type:"Kitchen",Q_Desc:"Microwave Oven", Ans:""},
  {Q_ID: 27, Q_Type:"Kitchen",Q_Desc:"Furniture", Ans:""},
  {Q_ID: 28, Q_Type:"Kitchen",Q_Desc:"Dishwasher", Ans:""},
  {Q_ID: 29, Q_Type:"Kitchen",Q_Desc:"Floor/Tiles", Ans:""},
  {Q_ID: 30, Q_Type:"Kitchen",Q_Desc:"Wall and Ceiling", Ans:""},
  {Q_ID: 31, Q_Type:"Kitchen",Q_Desc:"Eletric Outlets/Switches", Ans:""},
  {Q_ID: 32, Q_Type:"Bathroom",Q_Desc:"Walls and Ceiling", Ans:""},
  {Q_ID: 33, Q_Type:"Bathroom",Q_Desc:"Floor Covering", Ans:""},
  {Q_ID: 34, Q_Type:"Bathroom",Q_Desc:"Windows/Curtains/Blinds", Ans:""},
  {Q_ID: 35, Q_Type:"Bathroom",Q_Desc:"Doors/Door Lock", Ans:""},
  {Q_ID: 36, Q_Type:"Bathroom",Q_Desc:"Light Fixtures", Ans:""},
  {Q_ID: 37, Q_Type:"Bathroom",Q_Desc:"Cabinets/Drawers", Ans:""},
  {Q_ID: 38, Q_Type:"Bathroom",Q_Desc:"Counter Surfaces", Ans:""},
  {Q_ID: 39, Q_Type:"Bathroom",Q_Desc:"Sink and Faucet", Ans:""},
  {Q_ID: 40, Q_Type:"Bathroom",Q_Desc:"Toilet/Tissue Holder", Ans:""},
  {Q_ID: 41, Q_Type:"Bathroom",Q_Desc:"Shower and Tub", Ans:""},
  {Q_ID: 42, Q_Type:"Bathroom",Q_Desc:"Towel Racks", Ans:""},
  {Q_ID: 43, Q_Type:"Bathroom",Q_Desc:"Mirror/Medicine Cabinet", Ans:""},
  {Q_ID: 44, Q_Type:"Bathroom",Q_Desc:"Water (Hot and Pressure)", Ans:""},
  {Q_ID: 45, Q_Type:"Bathroom",Q_Desc:"Electric Outlets/Switches", Ans:""},
  {Q_ID: 46, Q_Type:"Bathroom",Q_Desc:"Vent/Exhaust Fan", Ans:""},
  {Q_ID: 47, Q_Type:"Bedrooms",Q_Desc:"Walls and Ceiling", Ans:""},
  {Q_ID: 48, Q_Type:"Bedrooms",Q_Desc:"Floor Covering", Ans:""},
  {Q_ID: 49, Q_Type:"Bedrooms",Q_Desc:"Windows/Curtains/Blinds", Ans:""},
  {Q_ID: 50, Q_Type:"Bedrooms",Q_Desc:"Door/Door Lock", Ans:""},
  {Q_ID: 51, Q_Type:"Bedrooms",Q_Desc:"Light Fixtures", Ans:""},
  {Q_ID: 52, Q_Type:"Bedrooms",Q_Desc:"Closets/Shelves",  Ans:""},
  {Q_ID: 53, Q_Type:"Bedrooms",Q_Desc:"Shelves", Ans:""},
  {Q_ID: 54, Q_Type:"Bedrooms",Q_Desc:"Molding and Baseboards", Ans:""},
  {Q_ID: 55, Q_Type:"Bedrooms",Q_Desc:"Furniture", Ans:""},
  {Q_ID: 56, Q_Type:"Bedrooms",Q_Desc:"Mirror", Ans:""},
  {Q_ID: 57, Q_Type:"Bedrooms",Q_Desc:"Heating/Cooling Units", Ans:""},
  {Q_ID: 58, Q_Type:"Bedrooms",Q_Desc:"Bunks/Storage Units", Ans:""},
  {Q_ID: 59, Q_Type:"Kitchen2",Q_Desc:"Stove/Oven", Ans:""},
  {Q_ID: 60, Q_Type:"Kitchen2",Q_Desc:"Range/Hood", Ans:""},
  {Q_ID: 61, Q_Type:"Kitchen2",Q_Desc:"Sink/Faucet", Ans:""},
  {Q_ID: 62, Q_Type:"Kitchen2",Q_Desc:"Refrigerator/Refrigerator Bulb", Ans:""},
  {Q_ID: 63, Q_Type:"Kitchen2",Q_Desc:"Light Fixture", Ans:""},
  {Q_ID: 64, Q_Type:"Kitchen2",Q_Desc:"Cabinets/Drawers", Ans:""},
  {Q_ID: 65, Q_Type:"Kitchen2",Q_Desc:"Counter Surfaces", Ans:""},
  {Q_ID: 66, Q_Type:"Kitchen2",Q_Desc:"Garbage Disposal", Ans:""},
  {Q_ID: 67, Q_Type:"Kitchen2",Q_Desc:"Microwave Oven", Ans:""},
  {Q_ID: 68, Q_Type:"Kitchen2",Q_Desc:"Furniture", Ans:""},
  {Q_ID: 69, Q_Type:"Kitchen2",Q_Desc:"Dishwasher", Ans:""},
  {Q_ID: 70, Q_Type:"Kitchen2",Q_Desc:"Floor/Tiles", Ans:""},
  {Q_ID: 71, Q_Type:"Kitchen2",Q_Desc:"Wall and Ceiling", Ans:""},
  {Q_ID: 72, Q_Type:"Kitchen2",Q_Desc:"Electric Outlets/Switches", Ans:""});
  UpdateContext({Blue1: true, Blue2:false, Blue3: false, Blue4: false, Blue5: false});
  UpdateContext({RoomD:"Bedrooms"});UpdateContext({Notes:false});UpdateContext({Comment10:false});UpdateContext({Dropdown: false})
  

Collection #2: SubmitData.  This is how we store the data on the device. 

 

Set(now1,Now());
Collect(SubmitData,
{
Q1: LookUp(Data1, Q_ID=1).Ans,
Q2: LookUp(Data1, Q_ID=2).Ans,
Q3: LookUp(Data1, Q_ID=3).Ans,
Q4: LookUp(Data1, Q_ID=4).Ans,
Q5: LookUp(Data1, Q_ID=5).Ans,
Q6: LookUp(Data1, Q_ID=6).Ans,
Q7: LookUp(Data1, Q_ID=7).Ans,
Q8: LookUp(Data1, Q_ID=8).Ans,
Q9: LookUp(Data1, Q_ID=9).Ans,
Q10: LookUp(Data1, Q_ID=10).Ans,
Q11: LookUp(Data1, Q_ID=11).Ans,
Q12: LookUp(Data1, Q_ID=12).Ans,
Q13: LookUp(Data1, Q_ID=13).Ans,
Q14: LookUp(Data1, Q_ID=14).Ans,
Q15: LookUp(Data1, Q_ID=15).Ans,
Q16: LookUp(Data1, Q_ID=16).Ans,
Q17: LookUp(Data1, Q_ID=17).Ans,
Q18: LookUp(Data1, Q_ID=18).Ans,
Q19: LookUp(Data1, Q_ID=19).Ans,
Q20: LookUp(Data1, Q_ID=20).Ans,
Q21: LookUp(Data1, Q_ID=21).Ans,
Q22: LookUp(Data1, Q_ID=22).Ans,
Q23: LookUp(Data1, Q_ID=23).Ans,
Q24: LookUp(Data1, Q_ID=24).Ans,
Q25: LookUp(Data1, Q_ID=25).Ans,
Q26: LookUp(Data1, Q_ID=26).Ans,
Q27: LookUp(Data1, Q_ID=27).Ans,
Q28: LookUp(Data1, Q_ID=28).Ans,
Q29: LookUp(Data1, Q_ID=29).Ans,
Q30: LookUp(Data1, Q_ID=30).Ans,
Q31: LookUp(Data1, Q_ID=31).Ans,
Q32: LookUp(Data1, Q_ID=32).Ans,
Q33: LookUp(Data1, Q_ID=33).Ans,
Q34: LookUp(Data1, Q_ID=34).Ans,
Q35: LookUp(Data1, Q_ID=35).Ans,
Q36: LookUp(Data1, Q_ID=36).Ans,
Q37: LookUp(Data1, Q_ID=37).Ans,
Q38: LookUp(Data1, Q_ID=38).Ans,
Q39: LookUp(Data1, Q_ID=39).Ans,
Q40: LookUp(Data1, Q_ID=40).Ans,
Q41: LookUp(Data1, Q_ID=41).Ans,
Q42: LookUp(Data1, Q_ID=42).Ans,
Q43: LookUp(Data1, Q_ID=43).Ans,
Q44: LookUp(Data1, Q_ID=44).Ans,
Q45: LookUp(Data1, Q_ID=45).Ans,
Q46: LookUp(Data1, Q_ID=46).Ans,
Q47: LookUp(Data1, Q_ID=47).Ans,
Q48: LookUp(Data1, Q_ID=48).Ans,
Q49: LookUp(Data1, Q_ID=49).Ans,
Q50: LookUp(Data1, Q_ID=50).Ans,
Q51: LookUp(Data1, Q_ID=51).Ans,
Q52: LookUp(Data1, Q_ID=52).Ans,
Q53: LookUp(Data1, Q_ID=53).Ans,
Q54: LookUp(Data1, Q_ID=54).Ans,
Q55: LookUp(Data1, Q_ID=55).Ans,
Q56: LookUp(Data1, Q_ID=56).Ans,
Q57: LookUp(Data1, Q_ID=57).Ans,
Q58: LookUp(Data1, Q_ID=58).Ans,
Q59: LookUp(Data1, Q_ID=59).Ans,
Q60: LookUp(Data1, Q_ID=60).Ans,
Q61: LookUp(Data1, Q_ID=61).Ans,
Q62: LookUp(Data1, Q_ID=62).Ans,
Q63: LookUp(Data1, Q_ID=63).Ans,
Q64: LookUp(Data1, Q_ID=64).Ans,
Q65: LookUp(Data1, Q_ID=65).Ans,
Q66: LookUp(Data1, Q_ID=66).Ans,
Q67: LookUp(Data1, Q_ID=67).Ans,
Q68: LookUp(Data1, Q_ID=68).Ans,
Q69: LookUp(Data1, Q_ID=69).Ans,
Q70: LookUp(Data1, Q_ID=70).Ans,
Q71: LookUp(Data1, Q_ID=71).Ans,
Q72: LookUp(Data1, Q_ID=72).Ans,
ID:If(IsEmpty(SubmitData),Last(h2a2).ID+1,Last(SubmitData).ID+1),
Counter: If(IsEmpty(SubmitData),1,Last(SubmitData).Counter+1),
ddate: date100.Text,
User: User().FullName,
Location: LookUp(Fix,Q_ID=1).Location,
RM: LookUp(Fix,Q_ID=2).Room,
MaxOccupants: MO.Text,
Comment: Comment.Text,
CommentType: commenttype.SelectedText.Value,
CloseDate:"",
Status: If(Checkbox1.Value=true,"Open","N/A")
}
);
SaveData(SubmitData,"datasave");Reset(Comment);Clear(Data1); Navigate(Home,ScreenTransition.None)

Finally, the patch to submit it to the dataset.  

ForAll(SubmitData,Patch(h2a2,DefaultsMyTable,
{
ID:ID,
Counter:Counter,
ddate: ddate,
User: User,
Location: Location,
RM: RM,
MaxOccupants: MaxOccupants,
Comment: Comment,
CommentType: CommentType,
CloseDate: CloseDate,
Status: Status,
Q1:Q1,
Q2:Q2,
Q3:Q3,
Q4:Q4,
Q5:Q5,
Q6:Q6,
Q7:Q7,
Q8:Q8,
Q9:Q9,
Q10:Q10,
Q11:Q11,
Q12:Q12,
Q13:Q13,
Q14:Q14,
Q15:Q15,
Q16:Q16,
Q17:Q17,
Q18:Q18,
Q19:Q19,
Q20:Q20,
Q21:Q21,
Q22:Q22,
Q23:Q23,
Q24:Q24,
Q25:Q25,
Q26:Q26,
Q27:Q27,
Q28:Q28,
Q29:Q29,
Q30:Q30,
Q31:Q31,
Q32:Q32,
Q33:Q33,
Q34:Q34,
Q35:Q35,
Q36:Q36,
Q37:Q37,
Q38:Q38,
Q39:Q39,
Q40:Q40,
Q41:Q41,
Q42:Q42,
Q43:Q43,
Q44:Q44,
Q45:Q45,
Q46:Q46,
Q47:Q47,
Q48:Q48,
Q49:Q49,
Q50:Q50,
Q51:Q51,
Q52:Q52,
Q53:Q53,
Q54:Q54,
Q55:Q55,
Q56:Q56,
Q57:Q57,
Q58:Q58,
Q59:Q59,
Q60:Q60,
Q61:Q61,
Q62:Q62,
Q63:Q63,
Q64:Q64,
Q65:Q65,
Q66:Q66,
Q67:Q67,
Q68:Q68,
Q69:Q69,
Q70:Q70,
Q71:Q71,
Q72:Q72
}));
Clear(SubmitData);Set(Counter,1);ClearCollect(Counter2,Counter);Reset(date100

 

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.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (1,686)