how to correct use user_id in a graph

I’m trying to create a graph that shows the entry for a particular user.  The “current” user (the respondent that just finished entering data would be great) but I couldn’t get it to work.  Then I tried something I thought would be simpler:

[frm-graph id=198 truncate=75 truncate_label=15 user_id=50]

Which I thought would show the results from a single user (I got the id right out of the entry) for a single question (a check-box field.) But that didn’t work either.

What am I doing wrong?

Thanks,

SC

Do you have a user ID field in your form?

Stephanie: I assumed the user ID field is generated automatically.  I see it in the entries, e.g., "Entry ID: 50" and I assumed that was the ID.  So is the "user_id" something I have to specially enable?  How do I do that?

Thanks,

Scott

 

Yes. You need a "hidden user ID" field added to your form.

Stephanie: OK, I put a "hidden user ID" in the form.  First thing I noticed is that the result is not an integer, it's a name. Specifically, mine -- which is to say my logon.  I was assuming the "hidden field ID" would generate the integer that the shortcode (seems to) require.  This represents something of a problem for testing, but beyond that, my survey won't require anybody to logon.

What I'm trying to do is allow the user to see their results (or at least part of them) as compared to the entire universe of respondents.  I'm guessing that this is correct form:

[frm-graph id=198 truncate=75 truncate_label=15 user_id=current]

But I defintiely don't want to require people to have a logon to generate a unique ID.  Am I still not understanding the application of the hidden field?

Thanks,SC

Are you inserting this shortcode in a custom display? If so, you can use
[frm-graph id=198 truncate=75 truncate_label=15 user_id=[25 show=id]]
Replace 25 with the id of your user ID field.

Stephanie: I am not using a custom display.  I assumed from what I read on the help pages that the code would work like any other shortcode.  Do I need to use a custom display?

Secondly, I'm still confused about whether each respondent will have to logon?

Thanks,

SC

 

It does work like any other shortcode, but how are you planning on getting the id of the user to display?

Stephanie: I assumed that when I added the hidden ID code, the system would generate a unique id, i.e., an integer, which is what the syntax (apparently) calls for.  I assumed that by using "user_id=current" the unique id of the person filling out the survey form would populate the shortcode with the id.

Did I misunderstand the instructions?

Thanks,

SC

The hidden user ID field saves the ID of the logged in user. This is the only dependable way to know if you are showing the correct information. user_id=current will do the job, if you are wanting the show the user their own information. In order to use this option, users must be logged in when they submit as well as when they are viewing the results.

Stephanie: OK, thanks.  SC

Topic closed.