How to manage Progress Status movements in a form - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

How to manage Progress Status movements in a form

Last post 09-23-2021 07:47 AM by Hilary Stoupa. 16 replies.
Page 1 of 2 (17 items) 1 2 Next >
Sort Posts: Previous Next
  • 09-03-2021 07:09 AM

    How to manage Progress Status movements in a form

    Hi InfoPath Devs!
    I'm sure this is a common use case and wondering if there is an elegant way to manage progress status changes or a state matrix in a field WITHOUT the need for code/SP Designer or Power Automate.
    For example I have a "Progress Status" field with 10 choices = Status 1 -> Status 10
    When a user creates a new item the status defaults to Status 1, and from this Status you can only move to Status 2 so it should only appear as selectable in the same field.
    If I'm at Status 2 then I can only go to Status 3 or Status 5 and so on depending on what Status I'm at
    Would this be possible to do just in one field or would it probably need more than 1 field to be able trigger some update field rules etc?
    I have "hacked" this before by creating multiple views of the same data and in particular views only particular values in the Status field are available, but with this form it could become a maintenance nightmare, so any suggestions welcome?!
    I'm using Sharepoint to store the data so was also thinking maybe an external SP list that maintains the state matrix but will that work all in one field?
    Thanks
    Mark
  • 09-09-2021 08:49 AM In reply to

    Re: How to manage Progress Status movements in a form

    Here's a sample file - right click the linked form, save locally. Right click the saved form, right click and select design to open in design mode, and then you can preview, see if this is kind of what you are looking for?
    Hilary Stoupa

  • 09-09-2021 10:39 AM In reply to

    Re: How to manage Progress Status movements in a form

    Awesome Hilary this helps alright, thanks!

    So it's a one column SharePoint list to hold the stages 1-> 12 for example.
    Then in the form Stages field entries set the filter exactly as you have, selecting the correct field that holds the values form the external list,

    preceding-sibling::Status[1] = xdXDocument:get-DOM()/my:myFields/my:field1
    following-sibling::Status[1] = xdXDocument:get-DOM()/my:myFields/my:field1

    And this allows you to go to the next stage or back to the previous stage.

    I know they have multiple jump off points at some stages i.e. it could possibly go down a happy path or an alternative path, is this possible too or are we limited to one stage movements?

    This is great though thanks!
  • 09-13-2021 08:08 AM In reply to

    Re: How to manage Progress Status movements in a form

    I suppose if you had a list with all the options - like Stage 1 can go to 2, 5 or 8 or something, it might be possible? I'll try to take a look in the next day or so and see if I can put together a sample.
    Hilary Stoupa

  • 09-14-2021 06:11 AM In reply to

    Re: How to manage Progress Status movements in a form

    Yeah if it can be managed with a list and needs an extra field that would work either, I'm just not getting it to work all within one field but if that's possible then great!
  • 09-14-2021 08:01 AM In reply to

    Re: How to manage Progress Status movements in a form

    So, I added another XML file to this copy, that has stages and paths - save the XML from the form's resource files and you'll see the data (or put the secondary data source on the form). I've set the paths so that stages 1 & 2 can also go to Stage 5, and so that Stage 5 can also go to stages 9 or 10. I only had to add one more filter on the dropdown for this to work as anticipated - hopefully this will meet your needs.
    Hilary Stoupa

  • 09-17-2021 05:45 AM In reply to

    Re: How to manage Progress Status movements in a form

    Hi Hilary

    This is it exactly, thanks.
    Just so I'm clear, i would create a list with 2 columns as use as the data source, then replicate the expressions and filters as per your example and should be good to go?

    Stage Path
    Stage1 Stage2
    Stage1 Stage4
    Stage2 Stage3
    Stage2 Stage5


    Thanks again
  • 09-17-2021 11:46 AM In reply to

    Re: How to manage Progress Status movements in a form

    Yeah, and it could probably be done with a single list - the stage dropdown would need to only show unique items - I just added a second XML because it was faster for me than re-doing the initial work :)
    Hilary Stoupa

  • 09-21-2021 12:46 AM In reply to

    Re: How to manage Progress Status movements in a form

    Hi Hilary
    I never used the xml resource files before but might have to go that way as I can't get the one SharePoint list with two columns Stage and Path to work?!
    The field is just blank, I assume I don't need the expressions and just need your 4th filter condition => field1 is equal to Path[Stage = field1]

    I assume it's blank because I have nothing defined as a value in the actual field on the form ?
    Thanks again..
  • 09-21-2021 05:43 AM In reply to

    Re: How to manage Progress Status movements in a form

    Also when I use the xml approach with the 2 files I get blank so must be doing something wrong?

    Here is your Data source entry
    /Statuses/Status[. = xdXDocument:get-DOM()/my:myFields/my:field1 or . = xdXDocument:GetDOM("StagePaths")/StagePaths/StagePath/Path[../Stage = xdXDocument:get-DOM()/my:myFields/my:field1]]

    and here is mine
    /Statuses/Status[. = xdXDocument:get-DOM()/dfs:myFields/dfs:dataFields/my:SharePointListItem_RW/my:Stages or . = xdXDocument:GetDOM("StagePaths")/StagePaths/StagePath/Path[../Stage = xdXDocument:get-DOM()/dfs:myFields/dfs:dataFields/my:SharePointListItem_RW/my:Stages]]

    Both using Stages file as data source

  • 09-21-2021 07:22 AM In reply to

    Re: How to manage Progress Status movements in a form

    Could I see your form where you are using a SharePoint List? I'm assuming you'd prefer that approach?
    Hilary Stoupa

  • 09-21-2021 07:39 AM In reply to

    Re: How to manage Progress Status movements in a form

    See attached, I just did up a quick one for the field in question as the full form is rather large with lots of data in it
  • 09-22-2021 08:59 AM In reply to

    Re: How to manage Progress Status movements in a form

    So, in my sample, I'm setting the default value of the dropdown field to the first stage option for the dropdown. Is that what you'll be doing in your form as well? Setting to the first option? What is the text value of that? What does your stages list data look like? Could you attach a screenshot of that?
    Hilary Stoupa

  • 09-22-2021 10:08 AM In reply to

    Re: How to manage Progress Status movements in a form

    No I wasn't doing that , I set it as "Stage 1" and now only Stage 1 shows in the field
    My list will be simple as per attached and as outlined above, 2 columns, one with Stage and one with Path
    If something else is needed to make it work I'm fine with that but can' t seem to get your xml method to work either in my form and the only other difference I see is that I'm using a browser form to save data in a sharepoint list and your sample does not?

  • 09-22-2021 11:09 AM In reply to

    Re: How to manage Progress Status movements in a form

    Oh, I see the difference now! Changing the last filter on your dropdown the "The expression" and doing the same with mine, I see you are using a relative path to a field where I'm using an absolute path. Try this expression:

    . = xdXDocument:GetDOM("Stages")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Path[../d:Title = xdXDocument:get-DOM()/my:myFields/my:field1]

    Hilary Stoupa

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