Convert data retrieved with a formula to a value - InfoPath Dev
in

InfoPath Dev

Convert data retrieved with a formula to a value

Last post 09-06-2012 08:50 AM by Hilary Stoupa. 14 replies.
Page 1 of 1 (15 items)
Sort Posts: Previous Next
  • 07-02-2012 02:59 PM

    Convert data retrieved with a formula to a value

    I have a form that moves via email to sequential users to perform actions.  The first user retrieves data from a SharePoint list using formulas.  This user has access to the SharePoint list but subsequent users do not and may not have access.  The form is then sent to a second user (who does not have access to the SharePoint list) and this user is unable to open the form because they don't have access to the list.  Is there a way to resolve this issue?  OR is there a way for the first user to easily replace the formulas in multiple fields with the values returned to the form.  Would this eliminate the error regarding access?  The data connection would still exist but would not be needed by the second and following users. 

  • 07-03-2012 04:09 PM In reply to

    Re: Convert data retrieved with a formula to a value

    Sounds like you are using default values that require the secondary data source - can you replace those with rules?

    Hilary Stoupa

  • 07-05-2012 05:18 AM In reply to

    Re: Convert data retrieved with a formula to a value

    I would still need the secondary data source to retrieve the values even if they were retrieved with a rule.  Do you think this would change the access issue?

     

  • 07-05-2012 10:36 AM In reply to

    Re: Convert data retrieved with a formula to a value

    Well, generally, what I think is that since your first user has access to the lists, instead of running the data connection on load, you should run it in open rules. Check one or more of the fields that are populated via this data connection - if they are blank you could perhaps assume the form was new, query the data connection and fill in the form fields using rules. Then the data connection is only executing when the first user fills out a new form.

    Hilary Stoupa

  • 07-05-2012 12:30 PM In reply to

    Re: Convert data retrieved with a formula to a value

    OK looks like I'm closer.  I changed to retreive the data using rules and a button.  The data is retrieved, I email the form on to the next user who does not have SharePoint access, they are able to open the form, but the data that was retrieved from SharePoint is missing.  "Store a copy of the data in the form template" is checked in the data connection wizard.

  • 07-05-2012 12:38 PM In reply to

    Re: Convert data retrieved with a formula to a value

    I guess I may not understand what you mean by "data retrieved from SharePoint". Here's what I was assuming - that you had default values that rely on data not all users have access to.

    If you are using rules to set main data source fields with values from your secondary data source that not all users have access to - well, the main data fields should still have the data in them. Unless your rules are running even when the user doesn't have access? How did you set up your rules?

    Hilary Stoupa

  • 07-05-2012 01:20 PM In reply to

    Re: Convert data retrieved with a formula to a value

    I'm pretty new to this so may not be using the best language to describe nor the best methods...    So I have text boxes and in the Text Box Properies window Default Value box entered a formula directing to a specific field in the secondary data source (SharePoint) filtered by the ID in each data source.  The "refresh value when formula is recalculated" box is checked.  The Data Connection is set up to "Store a copy of the data in the form template" but the "automatically retrieve data when form is opened" box is not checked.  The action rule, "Query for data using a data connection" is applied to a button.  Data is retrieved when the button is clicked.  Are you referring to a different way of applying rules? 

  • 07-05-2012 02:07 PM In reply to

    Re: Convert data retrieved with a formula to a value

    Yup - you are using default values. Which means if the user doesn't have access to the data, you are going to have "disappearing" data - the store data for use when offline is used if the user is actually offline - yours aren't - they just don't have access.

    Instead, I think you should add form load rules. In InfoPath 2010, those are on the data tab of the ribbon - in IP 2007, under Tools / Form options.

    Then, as I said above, you'd want to use conditions on your rules - you don't want to go setting those fields unless the form is new - you'd need to make sure those fields are blank. Let's pretend that one of the fields you are setting is called Product, just so I have something concrete to talk about.

    When the form is opened, you'd have open rules that would have the condition:

    Product is blank

    Then the rule actions would:

    1. Query the data connection
    2. Set the Product field

    Based on what you've said above, however, you may need to put the rules to set fields on the field that is providing you with your ID - you say your default values are using filters, so I imagine the user is selecting something in the form that you are basing your filters on. Hope that makes sense.

    Hilary Stoupa

  • 07-05-2012 02:17 PM In reply to

    Re: Convert data retrieved with a formula to a value

    OK.  I'm using 2010.  So when I am in Form Load/New/Action rule, which action do I select:  "Set a field's value" or "Query for data" or "Show the value of a field or formula"?

  • 07-05-2012 02:23 PM In reply to

    Re: Convert data retrieved with a formula to a value

    Again, as I said above - form load rules may not be the right place, since you've said that use a value in the form to filter your SharePoint list data. I'd probably set the rules on whatever main data source field is used to filter the the list data in the default values.

    First, if the SharePoint data source has not been queried, you'd need an action to query it. I think you could use a condition to check for the presence of one of its nodes.

    Then, you'd use rule actions that set field values - that's the goal, use rules to set main data source field values rather than depend on the presence of secondary data and defaults (which is what is causing you to have blanks). Feel free to attach your form template to the Options tab if you would like me to add rules to show what I mean a bit better.

    Hilary Stoupa

  • 07-05-2012 02:29 PM In reply to

    Re: Convert data retrieved with a formula to a value

    The fields which are populated from the secondary data source are those in the gray area.  The "filter" between the main and the secondary data source is the "ID" field.  Thanks very much for your help. 

  • 07-05-2012 02:39 PM In reply to

    Re: Convert data retrieved with a formula to a value

    Okay - added a rule to your button that sets three of the fields. You'll note I removed the default values from those three fields. You may want to disable that button after the form has been submitted - have a status field or something to track that. Oh, and you'll need to save this file locally, right click and select Design to open in design mode.

    -- Template removed at poster's request

    Hilary Stoupa

  • 07-06-2012 07:00 AM In reply to

    Re: Convert data retrieved with a formula to a value

    Thanks again for your help Hilary.  I'll give it a try.  Could you possibly remove the template form from your last post?  I've saved it locally.  Thanks.

  • 07-06-2012 09:49 AM In reply to

    Re: Convert data retrieved with a formula to a value

    I removed them both - have a great weekend!

    Hilary Stoupa

  • 09-06-2012 08:50 AM In reply to

    Re: Convert data retrieved with a formula to a value

    Hi - what are you talking about? The thread is about using the built in InfoPath List data connections, not the SharePoint web services. I don't understand what "Flex 2" or "Flex 3" have to do with the topic at hand - can you elaborate?

    Hilary Stoupa

Page 1 of 1 (15 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.