Using external datasource with repeating table - InfoPath Dev
in

InfoPath Dev

Using external datasource with repeating table

Last post 03-26-2012 06:37 AM by evevlo. 9 replies.
Page 1 of 1 (10 items)
Sort Posts: Previous Next
  • 01-21-2010 04:35 AM

    Using external datasource with repeating table

    Hi All

    I am trying to create a repeating table with an external sharepoint data source.

    here is my scenario:

    User is able to select a product from a list, when the list item is selected the price of the item is displayed in the next column.

    I want the user to be able to add multiple items to the form so i have used a repeating list, however, when i try to set the price to the data connection using a rule on the first row of the repeating table the same price is used for each additional product.

    Can you please explain how i achieve this?

    product 1    Cost1

    Product 2    Cost 2

    etc

    Many thanks

    Tomas

     

  • 01-21-2010 05:41 AM In reply to

    Re: Using external datasource with repeating table

    Hi Tomas,

    I believe the trick lies in the rules. You'll need to use current() to make sure that you're using the correct value (i.e. the current row).

    Now, I don't know the exact formulation of your rule, but see if this helps. If it doesn't help, can you provide more info on the rule itself so we can look at it?

     

    Ernesto Machado
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™


  • 01-21-2010 06:31 AM In reply to

    Re: Using external datasource with repeating table

    Hi

    Thanks for the response.

    I have actually deleted the initial table and started agian since posting this thread.

    Basically, i have a data connection to a sharepoint list which contains the following:

    ID   Product   Price

    I added a repeating table to the form with 2 columns.

    i have changed the first column from a text box to a drop down list, and configured the list box entries to lookup values from the sharepoint list data source.

    I want the user to be able to select the product, which will automatically update the second column with the price.

    Im not too sure i am going about this the right way.

    when i tried current() it returned an invalid argument exception error.

    Thanks for your help.

    Tomas

     

     

  • 01-21-2010 06:50 AM In reply to

    Re: Using external datasource with repeating table

    Ok, have just discovered that ever item i select is returning the first items price.

    i am using the following rule

    set fields value (price) to sharepoint list item field price.

    I know i am doing something wrong but can figure out what!

    Any help would be greatly appreciated!!!

    thanks

    Tomas

  • 01-21-2010 06:58 AM In reply to

    Re: Using external datasource with repeating table

    Are you filtering in the rule? It'll be something like this...

    Set a field's value: price (from the form) =  price (from the list) filtered such that itemname (from the list) = current()

    Ernesto Machado
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™


  • 01-21-2010 07:49 AM In reply to

    Re: Using external datasource with repeating table

    thanks again from the promot response.

    I am not too sure how to filter the secondary data source using = current.

    here is what i am doing:

    rule:

    action: set a fields value

    filed: form price

    value: (from insert field or group button)-->datasource-->secondary sharepoint datasource-->price,

    when i click on filter data i can only enter conditions such as "is equal to" "is not equal to" etc.

    From looking on the web it would appeat i have to edit the Xpath, is this right or do you know another way?

    Hope this makes sense.

    thanks

    Tomas

  • 01-25-2010 06:06 AM In reply to

    Re: Using external datasource with repeating table

    Hi

    Im still not having much luck with this one, when using the following rule:

    xdXDocument:GetDOM("Hardware")/dfs:myFields/dfs:dataFields/dfs:Hardware/@Price[/dfs:myFields/dfs:dataFields/dfs:Hardware/@ID=current()]

     I receive this error messabge:

    "/dfs:myFields/dfs:dataFields/dfs:Hardware/@ID" does not point to a valid location path of a field or group.

    Any suggestions?

    Thanks

    Tomas

     

  • 01-25-2010 07:40 AM In reply to

    Re: Using external datasource with repeating table

     You should be using something like [../@ID = current()] here, not the full path inside the brackets, but I don't think that's what's causing this error.  Are you sure that the capitalization of ID is correct and that you're using the correct namespace prefixes the whole way?  Could you attach a screenshot of your main data source?

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 01-27-2010 01:27 AM In reply to

    Re: Using external datasource with repeating table

    Hi Jimmy

    Thanks for the response.

    I tried using the ../@ID approach and received the error message mentioned in my previous post. I have also ensure ID is capatized.

    The issue i am having is determining the price field of an external datasource which is a sharepoint list.

    Please see below.

    Thanks

    Tomas

  • 03-26-2012 06:37 AM In reply to

    • evevlo
    • Not Ranked
    • Joined on 03-26-2012
    • Posts 1

    Re: Using external datasource with repeating table

     It is xslt function that change scope to current item so result will be like current()/../nameOfFieldWithId

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