cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
chaddavis
Nintex Newbie

Create & Update Text Document with Workflow

Jump to solution

I have a Content Editor Web Part that I'd like to have some HTML code in. I plan on using the web part's Content Link field to link to a text file with my code. However, that HTML will need to be dynamically updated. Specifically, an ID number in the code will need to be updated from a list field. 

Does anyone know of a way, presumably with a Nintex Workflow, to update or create/overwrite a text file in a SharePoint library? I plan to store the text file in SiteAssets.

Also, just so you have the big picture, this process is going to be in a site template, which means it will be used in numerous different sites after they're created from the template. The HTML code is an iFrame that points to a mapping site, and the iFrame URL has a query string parameter. That parameter will be different for each site, but it will be in a dedicated list column, which is where I'd like to pull it from.

0 Kudos
Reply
5 Replies
chaddavis
Nintex Newbie

Re: Create & Update Text Document with Workflow

Jump to solution

I think this is still a good question, but I ended up solving my issue with HTML and JavaScript instead of Nintex.

0 Kudos
Reply
chaddavis
Nintex Newbie

Re: Create & Update Text Document with Workflow

Jump to solution

In case anyone else has a similar issue in the future, I'll detail my solution here.

I ended up not using a Nintex solution at all. I used HTML and JavaScript and saved it to a txt file in the SiteAssets library at the root of the site collection. I then used the Content Link field in a Content Editor Web Part on the homepage of the site template to link to the txt file. This allowed me to use the same URL in the template for all sites built from it, and set it up so there's only one place to make any future changes that will automatically replicate across all sites.

My code queries the current site looking for a specific list that will always be named Project Statement and then returns the value from the BrightWorkProjectNumber field. 

**Important Note:

The Project Statement list will only ever have one entry.

If there were multiple, this code would only return the last item as it's written right now.

The code then tests to ensure the number exists.

If it does, it builds the iFrame code and includes the number in the URL.

If it doesn't, an error message is displayed on the screen asking for the number to be entered into the list.

Here's the code:

<div id='locationMap'></div>
<script type='text/javascript'>
     var clientContext = new SP.ClientContext(_spPageContextInfo.webServerRelativeUrl);
     var oList = clientContext.get_web().get_lists().getByTitle('Project Statement');
     var camlQuery = new SP.CamlQuery();
     this.collListItem = oList.getItems(camlQuery);
     clientContext.load(collListItem);
     clientContext.executeQueryAsync(
        Function.createDelegate(this, this.onSucceeded),
          Function.createDelegate(this, this.onQueryFailed)
     );
     function onSucceeded(sender, args) {
          var bwProjectNum = '';
          var listItemEnumerator = collListItem.getEnumerator();
          while (listItemEnumerator.moveNext()) {
               var oListItem = listItemEnumerator.get_current();
               bwProjectNum = oListItem.get_item('BrightWorkProjectNumber');
               console.log("Brightwork Project Number: " + bwProjectNum);
          }
          if (bwProjectNum) {
               bwProjectNum = bwProjectNum.match(/\d+$/g);
               console.log("Map Project Number: " + bwProjectNum);
               document.getElementById('locationMap').innerHTML =
                    "<iframe src='<My Map URL>?proj_ID=" + bwProjectNum + "' style='width:100%;height:450px;'></iframe><br>" +
                    "<a href='<My Map URL>?proj_ID=" + bwProjectNum + "' target='_blank'>View Larger Map</a>";
          } else {
               document.getElementById('locationMap').innerHTML =
                    "<div style='color:red;font-weight:bold;'>Please enter a Brightwork Project Number into the Project Statement to display map.</div>";
          }
     }          
     function onQueryFailed(sender, args) {
          document.getElementById('locationMap').innerHTML =
               "<div style='color:red;font-weight:bold;'>An error has occurred.<br>Please review the browser console (F12) for details.</div>";
          console.log('Project Location Map Error: ' + args.get_message() + '\n' + args.get_stackTrace());
     }
</script>
‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

And here's my end result:

or:

Reply
sophiahelt
Nintex Newbie

Remove the Epson printer error code 0x97 with the aid of professional

Jump to solution

The appearance of Epson printer is adorable in comparison with other printers. As soon as it comes up in business market, a great number of users become habitual of its printing service. Do you know the exact time line how long the Epson printer casts the worthwhile result to its end-user? Well, there is no confliction in the hardware of Epson printer. Otherwise, it would be difficult to achieve the outshine printing incidence. The performance of Epson printer would be degraded as some part gets full fraction during work operation. As some tides come in hardware part, you can get in the confluence of Epson printer error code 0x97. Being a straightforwardly person, getting the full freedom such stubborn issues is not a simple job. For getting the worthwhile features of Epson printer, you can close printing related queries along with our tech professional team. On redirection of undesired effect in the different portion of Epson printer, you do not hesitate to ask the help of tech nerd. For knowing more information, you can browse our web portal.

0 Kudos
Reply
robertduvall059
Nintex Newbie

Resolve HP printer error 2753 after visiting 123.HP/Setup

Jump to solution

Are you not accomplished to get print from your brand new and trendy HP printer? Does your printer display error 2753? You know, due to this horrible error code, all kind of HP printers such as inkjet, Desk Jet or others are suffering sudden offline issue. When this error crops up, the disastrous failure of the printer connection occurs and you can’t install printer once more. So, with an aim to turn on your printer, you need to fix error code 2753 conventional away. For this, the best solution is to update or reinstall printer’s genuine driver. You can visit 123.HP/Setup to download the newest version of driver and software related with your HP printer.

0 Kudos
Reply
augustwalker02
Nintex Newbie

Re: Remove the hp printer printer code Error 2753

Jump to solution

There is nothing more terrible than obtaining another printer and afterward discovering that you can't introduce it. Right now, one of the most famous printers around is that of the HP 3055 Deskjet. It is additionally one of the printers which appear to have the most issues with regards to establishment.

When introducing the printer, those that work with either Windows 8, 7 or Windows Vista will frequently be welcomed by "Blunder 2753". This is a calamitous disappointment of the establishment of the printer and it will stop suddenly.

This implies except if you tackle the issue you will be not able introduce the printer. Before I investigate how you can fix Error 2753 on a HP Printer I need to investigate what really causes the issue

you can also visit --- 123.hp/setup

0 Kudos
Reply