Show records per user in table widget in App MakerAssign hours to User in a Ruby on Rails appEvent Listener for App Maker Text Editor WidgetGoogle App maker User pickerAssociate data with widgets (not the other way around) - SQL dataShow/Hide columns in App Maker Table?How to email record as pdf to user with Google App MakerText Editor widget styling in Google App MakerGoogle App Maker query on Related recordsGoogle App Maker Widget Validate on Datasource selectDynamically adding or deleting widgets in google-app-maker

Valid Badminton Score?

Increase performance creating Mandelbrot set in python

Can criminal fraud exist without damages?

What't the meaning of this extra silence?

Personal Teleportation as a Weapon

Is expanding the research of a group into machine learning as a PhD student risky?

What would be the benefits of having both a state and local currencies?

Why is `const int& k = i; ++i; ` possible?

Is there any easy technique written in Bhagavad GITA to control lust?

What are the ramifications of creating a homebrew world without an Astral Plane?

Teaching indefinite integrals that require special-casing

Generic lambda vs generic function give different behaviour

Coordinate position not precise

Was Spock the First Vulcan in Starfleet?

Is it correct to write "is not focus on"?

Can I use my Chinese passport to enter China after I acquired another citizenship?

is this a spam?

Hostile work environment after whistle-blowing on coworker and our boss. What do I do?

Your magic is very sketchy

How to be diplomatic in refusing to write code that breaches the privacy of our users

How do we know the LHC results are robust?

Why "be dealt cards" rather than "be dealing cards"?

How does it work when somebody invests in my business?

Efficiently merge handle parallel feature branches in SFDX



Show records per user in table widget in App Maker


Assign hours to User in a Ruby on Rails appEvent Listener for App Maker Text Editor WidgetGoogle App maker User pickerAssociate data with widgets (not the other way around) - SQL dataShow/Hide columns in App Maker Table?How to email record as pdf to user with Google App MakerText Editor widget styling in Google App MakerGoogle App Maker query on Related recordsGoogle App Maker Widget Validate on Datasource selectDynamically adding or deleting widgets in google-app-maker













1















I'm almost finished with my first App Maker app (learned a lot, thanks for the help so far!). The app currently collects timestamp data when users log in and out of the work site. As the time between leaving and returning could be a few hours, and because App Maker is browser based, I originally had issues where the user was unable to complete the record and tap the Time_IN button. I solved this by moving the Time IN Button to a pop-up attached to the records page, so when the user came back to work they could open the record, tap Time IN and be on their way. Simple, right?



New Time IN method



My trouble now is that users were unable to see their own records on the UserRecords page, unless I made them admins, but then it grants access to the full table on not just their own, showing all records for all users. The navigation menu originally had this snippet of code which I removed:



(@user.roles).indexOf('Admins', 'Managers') !== -1


but I'm not sure if I've missed something as the issue still seems to be partly user role based? Here is an image of the datasource fields, there are only two models in this app, GatePass (as shown in the picture) & Directory (for user picker).



Datasource Fields



An export looks like this (and the idea is to get each user their own data, not the whole source table):



Export data



Also, this is what the users input page looks like now (if it helps), I managed to get the user email to autofill with record.Email = Session.getActiveUser().getEmail(); in the onBeforeCreate:



User Entry Latest



In a nutshell, the user should only see their records in the UserRecords page so they can access and complete their submission. The same is doubly true for their exports. Can anyone please help?










share|improve this question



















  • 1





    You can either do this with a different datasource or with the same datasource using query paramateres. To help you a bit more, could you please edit your question and post a screenshot of how your model looks. I'm interested in the fields and the datasources.

    – Morfinismo
    Mar 7 at 12:43











  • Edited and updated :)

    – Wayne Strydom
    Mar 7 at 12:55











  • It just occurred to me to mention that my colleague, who was not admin at the time of initial testing, made multiple entries but none of them made it to the table as stored data until after I had made him an admin. I dunno why this would be?

    – Wayne Strydom
    Mar 7 at 13:04















1















I'm almost finished with my first App Maker app (learned a lot, thanks for the help so far!). The app currently collects timestamp data when users log in and out of the work site. As the time between leaving and returning could be a few hours, and because App Maker is browser based, I originally had issues where the user was unable to complete the record and tap the Time_IN button. I solved this by moving the Time IN Button to a pop-up attached to the records page, so when the user came back to work they could open the record, tap Time IN and be on their way. Simple, right?



New Time IN method



My trouble now is that users were unable to see their own records on the UserRecords page, unless I made them admins, but then it grants access to the full table on not just their own, showing all records for all users. The navigation menu originally had this snippet of code which I removed:



(@user.roles).indexOf('Admins', 'Managers') !== -1


but I'm not sure if I've missed something as the issue still seems to be partly user role based? Here is an image of the datasource fields, there are only two models in this app, GatePass (as shown in the picture) & Directory (for user picker).



Datasource Fields



An export looks like this (and the idea is to get each user their own data, not the whole source table):



Export data



Also, this is what the users input page looks like now (if it helps), I managed to get the user email to autofill with record.Email = Session.getActiveUser().getEmail(); in the onBeforeCreate:



User Entry Latest



In a nutshell, the user should only see their records in the UserRecords page so they can access and complete their submission. The same is doubly true for their exports. Can anyone please help?










share|improve this question



















  • 1





    You can either do this with a different datasource or with the same datasource using query paramateres. To help you a bit more, could you please edit your question and post a screenshot of how your model looks. I'm interested in the fields and the datasources.

    – Morfinismo
    Mar 7 at 12:43











  • Edited and updated :)

    – Wayne Strydom
    Mar 7 at 12:55











  • It just occurred to me to mention that my colleague, who was not admin at the time of initial testing, made multiple entries but none of them made it to the table as stored data until after I had made him an admin. I dunno why this would be?

    – Wayne Strydom
    Mar 7 at 13:04













1












1








1








I'm almost finished with my first App Maker app (learned a lot, thanks for the help so far!). The app currently collects timestamp data when users log in and out of the work site. As the time between leaving and returning could be a few hours, and because App Maker is browser based, I originally had issues where the user was unable to complete the record and tap the Time_IN button. I solved this by moving the Time IN Button to a pop-up attached to the records page, so when the user came back to work they could open the record, tap Time IN and be on their way. Simple, right?



New Time IN method



My trouble now is that users were unable to see their own records on the UserRecords page, unless I made them admins, but then it grants access to the full table on not just their own, showing all records for all users. The navigation menu originally had this snippet of code which I removed:



(@user.roles).indexOf('Admins', 'Managers') !== -1


but I'm not sure if I've missed something as the issue still seems to be partly user role based? Here is an image of the datasource fields, there are only two models in this app, GatePass (as shown in the picture) & Directory (for user picker).



Datasource Fields



An export looks like this (and the idea is to get each user their own data, not the whole source table):



Export data



Also, this is what the users input page looks like now (if it helps), I managed to get the user email to autofill with record.Email = Session.getActiveUser().getEmail(); in the onBeforeCreate:



User Entry Latest



In a nutshell, the user should only see their records in the UserRecords page so they can access and complete their submission. The same is doubly true for their exports. Can anyone please help?










share|improve this question
















I'm almost finished with my first App Maker app (learned a lot, thanks for the help so far!). The app currently collects timestamp data when users log in and out of the work site. As the time between leaving and returning could be a few hours, and because App Maker is browser based, I originally had issues where the user was unable to complete the record and tap the Time_IN button. I solved this by moving the Time IN Button to a pop-up attached to the records page, so when the user came back to work they could open the record, tap Time IN and be on their way. Simple, right?



New Time IN method



My trouble now is that users were unable to see their own records on the UserRecords page, unless I made them admins, but then it grants access to the full table on not just their own, showing all records for all users. The navigation menu originally had this snippet of code which I removed:



(@user.roles).indexOf('Admins', 'Managers') !== -1


but I'm not sure if I've missed something as the issue still seems to be partly user role based? Here is an image of the datasource fields, there are only two models in this app, GatePass (as shown in the picture) & Directory (for user picker).



Datasource Fields



An export looks like this (and the idea is to get each user their own data, not the whole source table):



Export data



Also, this is what the users input page looks like now (if it helps), I managed to get the user email to autofill with record.Email = Session.getActiveUser().getEmail(); in the onBeforeCreate:



User Entry Latest



In a nutshell, the user should only see their records in the UserRecords page so they can access and complete their submission. The same is doubly true for their exports. Can anyone please help?







user-interface widget report google-app-maker






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 7 at 12:54







Wayne Strydom

















asked Mar 7 at 11:56









Wayne StrydomWayne Strydom

368




368







  • 1





    You can either do this with a different datasource or with the same datasource using query paramateres. To help you a bit more, could you please edit your question and post a screenshot of how your model looks. I'm interested in the fields and the datasources.

    – Morfinismo
    Mar 7 at 12:43











  • Edited and updated :)

    – Wayne Strydom
    Mar 7 at 12:55











  • It just occurred to me to mention that my colleague, who was not admin at the time of initial testing, made multiple entries but none of them made it to the table as stored data until after I had made him an admin. I dunno why this would be?

    – Wayne Strydom
    Mar 7 at 13:04












  • 1





    You can either do this with a different datasource or with the same datasource using query paramateres. To help you a bit more, could you please edit your question and post a screenshot of how your model looks. I'm interested in the fields and the datasources.

    – Morfinismo
    Mar 7 at 12:43











  • Edited and updated :)

    – Wayne Strydom
    Mar 7 at 12:55











  • It just occurred to me to mention that my colleague, who was not admin at the time of initial testing, made multiple entries but none of them made it to the table as stored data until after I had made him an admin. I dunno why this would be?

    – Wayne Strydom
    Mar 7 at 13:04







1




1





You can either do this with a different datasource or with the same datasource using query paramateres. To help you a bit more, could you please edit your question and post a screenshot of how your model looks. I'm interested in the fields and the datasources.

– Morfinismo
Mar 7 at 12:43





You can either do this with a different datasource or with the same datasource using query paramateres. To help you a bit more, could you please edit your question and post a screenshot of how your model looks. I'm interested in the fields and the datasources.

– Morfinismo
Mar 7 at 12:43













Edited and updated :)

– Wayne Strydom
Mar 7 at 12:55





Edited and updated :)

– Wayne Strydom
Mar 7 at 12:55













It just occurred to me to mention that my colleague, who was not admin at the time of initial testing, made multiple entries but none of them made it to the table as stored data until after I had made him an admin. I dunno why this would be?

– Wayne Strydom
Mar 7 at 13:04





It just occurred to me to mention that my colleague, who was not admin at the time of initial testing, made multiple entries but none of them made it to the table as stored data until after I had made him an admin. I dunno why this would be?

– Wayne Strydom
Mar 7 at 13:04












1 Answer
1






active

oldest

votes


















1














In your model, go to the DATASOURCES tab. If you have more than one datasource showing up, then it's up to you to choose the right one. Make sure to uncheck the option Automatically load data.



enter image description here



Next, go the page where the table is located. Then on the table onAttach event put the following:



var ds = widget.datasource;
if(!app.user.role.Admins)
ds.query.filters.Email._equals = app.user.email;

ds.load();


That should do the trick. In regards to the permission issue with the admin role, make sure that the model has the proper permissions. For that, go the the model's SECURITY
tab and make sure to set the proper permissions.



enter image description here



References:



https://developers.google.com/appmaker/security/secure-app-data
https://developers.google.com/appmaker/models/datasources






share|improve this answer























  • Thanks! It works! I looked over the code and understand how it flows, so learned something new here :) Really appreciate the help, will keep running with the app and try implement the smaller features like locking the editing after a full record has been entered/submitted and how to email the report from within the app (only thing stumping me there is attaching the export/sheet to the email).

    – Wayne Strydom
    Mar 7 at 15:07










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55043215%2fshow-records-per-user-in-table-widget-in-app-maker%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














In your model, go to the DATASOURCES tab. If you have more than one datasource showing up, then it's up to you to choose the right one. Make sure to uncheck the option Automatically load data.



enter image description here



Next, go the page where the table is located. Then on the table onAttach event put the following:



var ds = widget.datasource;
if(!app.user.role.Admins)
ds.query.filters.Email._equals = app.user.email;

ds.load();


That should do the trick. In regards to the permission issue with the admin role, make sure that the model has the proper permissions. For that, go the the model's SECURITY
tab and make sure to set the proper permissions.



enter image description here



References:



https://developers.google.com/appmaker/security/secure-app-data
https://developers.google.com/appmaker/models/datasources






share|improve this answer























  • Thanks! It works! I looked over the code and understand how it flows, so learned something new here :) Really appreciate the help, will keep running with the app and try implement the smaller features like locking the editing after a full record has been entered/submitted and how to email the report from within the app (only thing stumping me there is attaching the export/sheet to the email).

    – Wayne Strydom
    Mar 7 at 15:07















1














In your model, go to the DATASOURCES tab. If you have more than one datasource showing up, then it's up to you to choose the right one. Make sure to uncheck the option Automatically load data.



enter image description here



Next, go the page where the table is located. Then on the table onAttach event put the following:



var ds = widget.datasource;
if(!app.user.role.Admins)
ds.query.filters.Email._equals = app.user.email;

ds.load();


That should do the trick. In regards to the permission issue with the admin role, make sure that the model has the proper permissions. For that, go the the model's SECURITY
tab and make sure to set the proper permissions.



enter image description here



References:



https://developers.google.com/appmaker/security/secure-app-data
https://developers.google.com/appmaker/models/datasources






share|improve this answer























  • Thanks! It works! I looked over the code and understand how it flows, so learned something new here :) Really appreciate the help, will keep running with the app and try implement the smaller features like locking the editing after a full record has been entered/submitted and how to email the report from within the app (only thing stumping me there is attaching the export/sheet to the email).

    – Wayne Strydom
    Mar 7 at 15:07













1












1








1







In your model, go to the DATASOURCES tab. If you have more than one datasource showing up, then it's up to you to choose the right one. Make sure to uncheck the option Automatically load data.



enter image description here



Next, go the page where the table is located. Then on the table onAttach event put the following:



var ds = widget.datasource;
if(!app.user.role.Admins)
ds.query.filters.Email._equals = app.user.email;

ds.load();


That should do the trick. In regards to the permission issue with the admin role, make sure that the model has the proper permissions. For that, go the the model's SECURITY
tab and make sure to set the proper permissions.



enter image description here



References:



https://developers.google.com/appmaker/security/secure-app-data
https://developers.google.com/appmaker/models/datasources






share|improve this answer













In your model, go to the DATASOURCES tab. If you have more than one datasource showing up, then it's up to you to choose the right one. Make sure to uncheck the option Automatically load data.



enter image description here



Next, go the page where the table is located. Then on the table onAttach event put the following:



var ds = widget.datasource;
if(!app.user.role.Admins)
ds.query.filters.Email._equals = app.user.email;

ds.load();


That should do the trick. In regards to the permission issue with the admin role, make sure that the model has the proper permissions. For that, go the the model's SECURITY
tab and make sure to set the proper permissions.



enter image description here



References:



https://developers.google.com/appmaker/security/secure-app-data
https://developers.google.com/appmaker/models/datasources







share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 7 at 13:30









MorfinismoMorfinismo

2,4781819




2,4781819












  • Thanks! It works! I looked over the code and understand how it flows, so learned something new here :) Really appreciate the help, will keep running with the app and try implement the smaller features like locking the editing after a full record has been entered/submitted and how to email the report from within the app (only thing stumping me there is attaching the export/sheet to the email).

    – Wayne Strydom
    Mar 7 at 15:07

















  • Thanks! It works! I looked over the code and understand how it flows, so learned something new here :) Really appreciate the help, will keep running with the app and try implement the smaller features like locking the editing after a full record has been entered/submitted and how to email the report from within the app (only thing stumping me there is attaching the export/sheet to the email).

    – Wayne Strydom
    Mar 7 at 15:07
















Thanks! It works! I looked over the code and understand how it flows, so learned something new here :) Really appreciate the help, will keep running with the app and try implement the smaller features like locking the editing after a full record has been entered/submitted and how to email the report from within the app (only thing stumping me there is attaching the export/sheet to the email).

– Wayne Strydom
Mar 7 at 15:07





Thanks! It works! I looked over the code and understand how it flows, so learned something new here :) Really appreciate the help, will keep running with the app and try implement the smaller features like locking the editing after a full record has been entered/submitted and how to email the report from within the app (only thing stumping me there is attaching the export/sheet to the email).

– Wayne Strydom
Mar 7 at 15:07



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55043215%2fshow-records-per-user-in-table-widget-in-app-maker%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

1928 у кіно

Захаров Федір Захарович

Ель Греко